Django fixtures auto populate time based fields -
i trying use fixtures auto populate fields category
field. how have defined it:
class timestampedmodel(models.model): """ timestampedmodel abstract base class model provides self-managed "created" , "modified" fields. """ created_on = models.datetimefield(auto_now_add=true) updated_on = models.datetimefield(auto_now=true) class category(timestampedmodel): name = models.charfield(max_length=255) is_regional = models.booleanfield(default=false) subtitle = models.charfield(max_length=255, null=true, default=none) is_selected = models.booleanfield(default=false)
i run following error:
problem installing fixture '/users/varunj/projects/backend/newsybackend/api/fixtures/admin_categories.yaml': not load api.category(pk=1): (1048, "column 'created_on' cannot null")
shouldn't fixture take care of subclass fields themselve, given auto_now anyway?
Comments
Post a Comment