I use mongoengine, and love it very.
now I work it with django, and I get a problem with it
how to set property for ListField
e.g.
this was my model
class Bussiness(Document):
tags = ListField(StringField())
and I want to use it on template like this:
{% for tag on bussiness.tags %}
{{ tag.url }}
{% endfor %}
but the tag.url I don’t want to save it to database, just hope to produce it on model level, and make tags only some string on database.
And if I hard code it on template, I have to write it everywhere, that was I disgust.
This wont work as tag is just a string (you have it defined as a
StringField).You could have tag as an embedded document with url being a property eg: