Navigation Menu

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

Allow dump_object to be used with primary keys that are longs #13

Merged
merged 1 commit into from Sep 25, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions fixture_magic/management/commands/dump_object.py
Expand Up @@ -41,8 +41,12 @@ def handle(self, *args, **options):
try:
objs = dump_me.objects.filter(pk__in=[int(i) for i in ids])
except ValueError:
# We might have primary keys thar are just strings...
objs = dump_me.objects.filter(pk__in=ids)
# We might have primary keys that are longs...
try:
objs = dump_me.objects.filter(pk__in=[long(i) for i in ids])
except ValueError:
# Finally, we might have primary keys that are strings...
objs = dump_me.objects.filter(pk__in=ids)

if options.get('kitchensink'):
related_fields = [rel.get_accessor_name() for rel in
Expand Down