Expando Model in Django

Is it possible to implement the "expando" model in Django, like the Google App Engine? I found a django application called django-expando on github, but it is still at an early stage.

+3
source share
1 answer

Perhaps, but it would be a shred of epic proportions. GAE uses another database project, known as a column-based database, and Django ORM is designed to communicate with relational databases. Since technically everything in GAE is stored in one really large table without a schema (why don't you need syncdbGAE applications), adding custom fields is easy. With relational databases, where each table stores exactly one kind of data (usually) and has a fixed schema, arbitrary fields are not so simple.

expando, , TextField , - , __setattr__ __getattr__, . :

  • -, .
  • -, expando , .

- , expando.

+2

Source: https://habr.com/ru/post/1730983/


All Articles