django-mongonaut icon indicating copy to clipboard operation
django-mongonaut copied to clipboard

Field's value gets replaced by Model's name if the name of field is 'name'

Open kaflesudip opened this issue 10 years ago • 3 comments

If I have a Document similar to this:

class MyDocument(Document):
    name = fields.StringField()

The value of 'name' is changed to 'MyDocument' i.e. the name of the Document itself.

kaflesudip avatar Dec 18 '14 09:12 kaflesudip

I am also facing the same issue. Will be great if you guys can point me in the right direction.

mohitm86 avatar Sep 20 '16 22:09 mohitm86

Do you have any more details on the issue?

garrypolley avatar Sep 20 '16 23:09 garrypolley

If I create a admin page for the above example

class MyDocument(Document): name = fields.StringField()

and set name = "My name" is the form when create or updating a new MyDocument, name field is still set as MyDocument.

i.e. document.name is always MyDocument no matter what I set it to.

mohitm86 avatar Sep 20 '16 23:09 mohitm86