I referred to this post for the question#1 to handle null values:
http://code.google.com/p/googleappengine/issues/detail?id=595

But I still don't know how to handle default values without having the
need to enter anything in the csv file...


On Mar 20, 5:24 pm, Mat <matdrap...@gmail.com> wrote:
> Hi,
>
> Here is my model class:
>
> class Listing(db.Model):
>     name = db.StringProperty()
>     value = db.FloatProperty()
>     createdDate = db.DateTimeProperty(auto_now_add=True)
>     createdBy = db.UserProperty(auto_current_user_add=True)
>
> and here is my loader class:
>
> class ListingLoader(Loader):
>     def __init__(self):
>         Loader.__init__(self, 'Listing',
>                         [('name', str),
>                          ('value', float),
>                          ('createdDate', datetime.datetime),
>                          ('createdBy', db.users.User),
>                          ])
>
> 1) How can I define a Null float value in the csv file? I tried
> writing an empty field in the csv file but I get an error "ValueError:
> empty string for float()"
>
> 2) How can I tell the loader to use the current user and current time
> for the createdBy and createdDate fields? When using a save query I
> don't need to provide those fields, how can do the same thing with the
> loader?
> Again, I tried writing an empty field in the csv file but I get this
> error: "TypeError: function takes at least 3 arguments (1 given)"
>
> Thank you,
> Mathieu
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to