You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A clear and concise description of what the bug is.
i want to use 'user_id' as the primary key for mongoengine ORM, but when i click the [edit] button from the author admin view, it shows:
mongoengine.errors.InvalidQueryError: Cannot resolve field "id"
so, is the 'id' name the only one ? could i use annother name, such as 'user_id' as the primary key?
To Reproduce
Explain how to reproduce the bug.
class Author(db.Document):
meta = {
'collection': 'author_profile'
}
user_id = db.StringField(min_length=3)
name = db.StringField(min_length=3)
description= db.StringField(max_length=20)
Describe the bug
A clear and concise description of what the bug is.
i want to use 'user_id' as the primary key for mongoengine ORM, but when i click the [edit] button from the author admin view, it shows:
mongoengine.errors.InvalidQueryError: Cannot resolve field "id"
so, is the 'id' name the only one ? could i use annother name, such as 'user_id' as the primary key?
To Reproduce
Explain how to reproduce the bug.
class Author(db.Document):
meta = {
'collection': 'author_profile'
}
user_id = db.StringField(min_length=3)
name = db.StringField(min_length=3)
description= db.StringField(max_length=20)
class AuthorView(ModelView):
pk_attr = "user_id"
fields = [
"name",
StringField('description')
]
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: