Why does subclassing model field requirement[1] for custom fields is
not applied to django core fields?
[1] http://tinyurl.com/l2lvbx
Any Django field classes has SubfieldBase metaclass declared, so for
an "initial" DateField attribute:
>>> ob = MyModel.objects.create(type=1,initial='2009-01-01')
>>> ob.initial
'2009-01-01'
when I set SubfieldBase metaclass for
django.db.models.fields.DateField as stated in documentation i have:
>>> ob = MyModel.objects.create(type=1,initial='2009-01-01')
>>> ob.initial
datetime.date(2009, 1, 1)
as expected, the to_python method convert the string to a date type.
Thanks!
daniel