Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
subfieldbase not in django core fields
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Daniel Vainsencher Maya Monteiro  
View profile  
 More options Jun 29, 2:48 pm
From: Daniel Vainsencher Maya Monteiro <dvainsenc...@gmail.com>
Date: Mon, 29 Jun 2009 15:48:15 -0300
Local: Mon, Jun 29 2009 2:48 pm
Subject: subfieldbase not in django core fields
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


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google