Groups
Groups
Sign in
Groups
Groups
Django users
Conversations
About
Send feedback
Help
get_or_create and foreign keys
310 views
Skip to first unread message
Thierry
unread,
Apr 28, 2008, 3:12:14 PM
4/28/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
The get or create syntax does not appear to support the following
syntax:
object, created = get_or_create(entity_id = 12)
it fails on the _id part.
is there anyway to give it numbers instead of objects?
davenaff
unread,
Apr 28, 2008, 9:55:48 PM
4/28/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
This might be a syntax problem. This is the syntax I use:
object, created = Entity.objects.get_or_create(id=12)
Reply all
Reply to author
Forward
0 new messages