我对gae很新,我找不到一个容易理解的例子。
这是我的sql:
CREATE TABLE Company
(
name varchar(100),
address varchar(100),
lat double(20, 10),
long double(20, 10),
phone varchar(15),
website varchar(50),
email varchar(50),
hiring boolean not null default 0 ,
about_us varchar(500),
approved boolean not null default 0
)
答案 0 :(得分:1)
如果你只是问django模型应该是什么样的。然后我想你想要一个这样的课:
class Company(models.Model):
name = models.CharField(max_length=100, null=True)
address = models.CharField(max_length=100, null=True)
lat = models.DecimalField(max_digits=20, decimal_places=10, null=True)
long = models.DecimalField(max_digits=20, decimal_places=10, null=True)
phone = models.CharField(max_length=15, null=True)
website = models.UrlField(max_length=50, null=True)
email = models.EmailField(max_length=50, null=True)
hiring = models.BooleanField(default=False)
about_us = models.CharField(max_length=500, null=True)
approved = models.BooleanField(default=False)