Reputation: 61
my models
class Result(Document) :
id = IntField()
turn = IntField()
url = StringField()
the id is not the primary key.
As you know, mongodb will generate a key named '_id'. So I use 'id' for another means. But in the django, the id or pk are means the primary key.
So, how can I get the field I want from the mongodb through django?
THX~
Upvotes: 1
Views: 1477
Reputation: 18101
Currently id
is reserved for the primary key - so can't be reused for a non primary key.
Upvotes: 2