开发者

Google App Engine is not creating table (python)

I have this model

class SiteUser(db.Model):
    site_user = db.UserProperty()
    total_votes = db.IntegerProperty(default=1)
    liked_items = db.StringProperty()

class Item(db.Model):
    user_who_liked_this_item = db.UserProperty()
    title = db.StringProperty()
    url = db.StringProperty()
    date = db.DateTimeProperty(auto_now_add=True)   
    points = db.IntegerProperty(default=1) 

Item table is created but SiteUser table is not cr开发者_StackOverflow社区eated. Can anyone help me understand what I am doing wrong?

Thanks?


There are no 'tables' on App Engine. A kind will show up in the datastore viewer if you have inserted at least one record with that kind; my guess is that you haven't inserted any SiteUser entities into the datastore.


You cannot Create a entity in admin console, Unless until there is atleast one record of that entity created programtically


When you use this the first time it will "create a table"

new_user = SiteUser()
new_user.liked_items = str(42)
new_user.put()
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜