berinhard / model_mommy

No longer maintained, please migrate to model_bakery
http://model-bakery.readthedocs.org/
Other
903 stars 141 forks source link

Nullable CharFields not supported #193

Closed umazalakain closed 10 years ago

umazalakain commented 10 years ago

I have a CharField in my model which declares uniqueness and is nullable:

class MyModel(models.Model):
    myfield = models.CharField(unique=True, null=True, max_length=100)

The reason for doing this is that Django doesn't consider equal for purposes of uniqueness two null values.

When I instantiate some of these objects with model mommy it automatically fills the field with data, Even when I explicitly say myfield=None or myfield=lambda: None. Is there any way of getting around this?

umazalakain commented 10 years ago

This issue is invalid

vandersonmota commented 10 years ago

¯(°_o)/¯