There has to be a better way, but I can't figure it out and this isn't
very important to my problem. The problem seems to be that the django
form won't actually set a dbmodel DateProperty to None. There does
not appear to be an issue with the StringProperty.
entity = data.save(commit=False)
for property in dbmodel.properties():
if self.request.POST[property]=="":
setattr(dbmodel, property, None)
entity.put()
On Aug 19, 9:01 am, Arun Shanker Prasad <[EMAIL PROTECTED]>
wrote:
> Hi,
>
> I have a fewdatefields, until recently I just used a text field to
> get the value and store it in the GAE datastore, it maps thedatein
> into y-m-d format. I needed to change the format and put a validation
> to check the user input, following are the changes I made to the form,
> startDate = forms.DateField(input_formats=['%d/%m/%Y'],
> widget=forms.TextInput(attrs={'class':'inp100','maxlength':'10'}),
> required=False)
>
> The validation part is working correctly. But when i try to remove
> thedatevalue from the form and try to update, the old values are still
> retained, they are not made into None ornull.
> NOTE: Updating thedatewith another validdateseems to work. I have
> also changed the initial value to get thedate.strftime(format).
>
> Any help will be appreciated, as I am new to Python and Django.
>
> I am using Django 0.96
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---