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 [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
-~----------~----~----~----~------~----~------~--~---