AppEngine: using the Expando class in Django NonRel?

I have an application using Django Nonrel for AppEngine.

I would like to use a dynamic model similar to the WebApp db.Expando class - is this possible? Expando class open to DNR layer?

+4
source share
2 answers

You can use DictField and ListField from djangotoolbox to create dynamic models in Django-nerel. For instance,

from djangotoolbox.fields import DictField class Image(models.Model): exif = DictField() 

and

 class Post(models.Model): words = ListField(models.CharField(max_length=500)) title = models.CharField(max_length=200) content = models.TextField(blank=True) 

See Option 3 of the Django dynamic model fields for more details.

+4
source

Django implements its own level of database abstraction - it is not built on the db App Engine module. If django does not provide it itself, it is not available.

-1
source

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


All Articles