how to make the meta dictionary dynamic?

21 views
Skip to first unread message

Willy Arnold

unread,
Nov 30, 2021, 3:34:12 PM11/30/21
to MongoEngine Users
in a mongoengine model how to make the meta dictionary dynamic?
the idea is to do something like
meta = {
    'collection': current_user.collection_name,
    'max_documents': current_user.max_documents,
    'max_size': current_user.max_size
    }
obviously if there is a cleaner method I would like to know more in a flask app

Jan Schrewe

unread,
Nov 30, 2021, 3:48:21 PM11/30/21
to mongoeng...@googlegroups.com
Meta classes? That’s what I’d look into anyhow https://towardsdatascience.com/metaclasses-e9d23ae44c2d

Hope this helps. 

Jan

On 30. Nov 2021, at 21:34, Willy Arnold <eken...@gmail.com> wrote:

in a mongoengine model how to make the meta dictionary dynamic?
--
You received this message because you are subscribed to the Google Groups "MongoEngine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongoengine-us...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongoengine-users/abe0cc89-679d-46e1-afea-d7027672e0d6n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages