Django dynamic model fields

前端 未结 3 1601
一生所求
一生所求 2020-11-22 08:38

I\'m working on a multi-tenanted application in which some users can define their own data fields (via the admin) to collect additional data in forms and re

3条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-22 08:56

    I've been working on pushing the django-dynamo idea further. The project is still undocumented but you can read the code at https://github.com/charettes/django-mutant.

    Actually FK and M2M fields (see contrib.related) also work and it's even possible to define wrapper for your own custom fields.

    There's also support for model options such as unique_together and ordering plus Model bases so you can subclass model proxy, abstract or mixins.

    I'm actually working on a not in-memory lock mechanism to make sure model definitions can be shared accross multiple django running instances while preventing them using obsolete definition.

    The project is still very alpha but it's a cornerstone technology for one of my project so I'll have to take it to production ready. The big plan is supporting django-nonrel also so we can leverage the mongodb driver.

提交回复
热议问题