I have an app using using Django Nonrel on AppEngine.
I'd like to use a dynamic model similar to WebApp's db.Expando class - is this possible? Is the Expando class exposed to the DNR layer?
I have an app using using Django Nonrel on AppEngine.
I'd like to use a dynamic model similar to WebApp's db.Expando class - is this possible? Is the Expando class exposed to the DNR layer?
You can use DictField & ListField from djangotoolbox to create dynamic models in Django-nonrel. For e.g.
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 Django dynamic model fields for more details.
Django implements its own DB abstraction layer - it's not built on App Engine's db module. If django does not provide it itself, it's not available.