Closed mamigot closed 9 years ago
Hi @miguel5, could you provide more details? Is this happening with any model? Which version are you using?
Thanks for the quick response, @vandersonmota ! This doesn't happen with every model (it works with some of them), but with this one specifically:
class MyModel(models.Model):
one= models.CharField(max_length=4096, blank=True, null=True)
two = models.TextField(blank=True, null=True)
three = models.AutoField(primary_key=True)
attributes = JsonBField(null=True, blank=True, default={})
Could the problem be the JSON field? I'm importing it as from django_pgjson.fields import JsonBField
, and using django-pgjson==0.2.3.
And I'm using model-mommy==1.2.4.
Thank you!
@miguel5 it looks like an error caused by JsonBField. Did you tried registering a custom generator for it? http://model-mommy.readthedocs.org/en/latest/how_mommy_behaves.html#custom-fields
Sorry @vandersonmota, I hadn't come across and therefore did not try the custom generators. Will do as soon as I get a chance! Thank you!
I'm getting an error when model_mommy saves to my Postgres database. This is the traceback:
Another model was instantiated using mommy without a problem --this is just one with a few more fields.
I have modified
MAX_LENGTH
andMAX_INT
ingenerators.py
but that hasn't fixed it. Please let me know if there is another parameter I should change though, and thank you!