Closed steinbachr closed 6 years ago
@steinbachr Indeed, we'll take a look soon. Meanwhile, you could create a recipe for that. http://model-mommy.readthedocs.org/en/latest/recipes.html
awesome, thanks @vandersonmota. I actually just ended up using the MOMMY_CUSTOM_FIELDS_GEN as a shim like so:
def mommy_timedelta_field():
import datetime
return datetime.timedelta(days=0)
def mommy_geometry_field():
from django.contrib.gis.geos import Point
return Point(0, 0)
MOMMY_CUSTOM_FIELDS_GEN = {
'django.contrib.gis.db.models.fields.GeometryField': mommy_geometry_field,
'timedelta.fields.TimedeltaField': mommy_timedelta_field,
}
Maybe just pull this in for GeoDjango (would be much appreciated since we use GeoDjango everywhere) https://github.com/sigma-geosistemas/mommy_spatial_generators
Is there any progress on this? Django with spatial fields is extremely common, and model-mommy would be better off supporting those fields. I have used both a self-written recipe as the generators from sigma-geosistema's, both work with mommy.
If there is still interest in adding this to the core of mommy, I'd be happy to submit a Pull Request. Please let me know.
Stack Trace: