Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle MultipleObjectsReturned for form data #12

Closed
wants to merge 4 commits into from
Closed

handle MultipleObjectsReturned for form data #12

wants to merge 4 commits into from

Conversation

chhantyal
Copy link
Contributor

We also need to handle MultipleObjectsReturned as we allow nullable display_key in table. So when display_key url param is empty, above exception is raised.

We could also do,

if display_key:
        data = FormModelData.objects.get(display_key=display_key)
else:
        data = None

Let me know which one you prefer.

@MarkusH
Copy link
Owner

MarkusH commented Dec 9, 2014

I'd prefer the if approach:

data = None
display_key = ...
if display_key is not None:
    data = ...

@MarkusH
Copy link
Owner

MarkusH commented Dec 9, 2014

Could you also add a test case to tests.test_views to check for the behavior, please.

@chhantyal
Copy link
Contributor Author

Sure, will add tests later in the evening

@MarkusH
Copy link
Owner

MarkusH commented Dec 9, 2014

Thanks. If you rebase to the current develop branch the tests for Django 1.8 should pass. I just pushed a fix.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling e0ba2d5 on chhantyal:develop into 2e7d3fc on MarkusH:develop.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) when pulling afdbef9 on chhantyal:develop into 2e7d3fc on MarkusH:develop.

@chhantyal
Copy link
Contributor Author

Sorry wrong branch, I forgot Github updates PR. But this commit might be good thing to pull in upstream https://github.com/chhantyal/django-dynamic-forms/commit/3ffc28c16211b33f4e69c5125d6e2066991896f5

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) when pulling afdbef9 on chhantyal:develop into 2e7d3fc on MarkusH:develop.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) when pulling b2d9775 on chhantyal:develop into 2e7d3fc on MarkusH:develop.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) when pulling b2d9775 on chhantyal:develop into 2e7d3fc on MarkusH:develop.

@MarkusH
Copy link
Owner

MarkusH commented Dec 12, 2014

Can you please submit 3 independent pull requests for the features.

@MarkusH MarkusH closed this Dec 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants