• 手机版

    扫码体验手机版

  • 微信公众号

    扫码关注公众号

国内首家协议开发

软芯音视解码保护平台

在线
客服

发布
需求

在线
聊天

天盟
APP

天盟APP下载

关注
微信

微信扫一扫访问
顶部

django 1.6 采用mysql数据库,表同步失败,怎么办?

我的models文件:

#coding:utf-8'''Created on 2013-11-11@author: Administrator'''from __future__ import unicode_literalsfrom django.db import modelsimport timeclass FaqCategory(models.Model):    id = models.AutoField(primary_key=True)    catname = models.CharField(max_length=150L, blank=True)    class Meta:        db_table = 't_faq_category'        verbose_name = u'faq_category'        verbose_name_plural = u'faq_category'        app_label = u'My_Category'    def __unicode__(self):        return self.catnameclass ProductCategory(models.Model):    id = models.AutoField(primary_key=True)    catname = models.CharField(max_length=150L, blank=True)    class Meta:        db_table = 't_product_category'        verbose_name = u'product_category'        verbose_name_plural = u'product_category'        app_label = u'My_Category'    def __unicode__(self):        return self.catnameclass ServiceCategory(models.Model):    id = models.AutoField(primary_key=True)    catname = models.CharField(max_length=150L, blank=True)    class Meta:        db_table = 't_service_category'        verbose_name = u'service_category'        verbose_name_plural = u'service_category'        app_label = u'My_Category'    def __unicode__(self):        return self.catnameclass AboutCategory(models.Model):    id = models.AutoField(primary_key=True)    catname = models.CharField(max_length=150L, blank=True)    class Meta:        db_table = 't_about_category'        verbose_name = u'about_category'        verbose_name_plural = u'about_category'        app_label = u'My_Category'    def __unicode__(self):        return self.catnameclass DownloadCategory(models.Model):    id = models.AutoField(primary_key=True)    catname = models.CharField(max_length=150L, blank=True)    class Meta:        db_table = 't_download_category'        verbose_name = u'download_category'        verbose_name_plural = u'download_category'        app_label = u'My_Category'    def __unicode__(self):        return self.catnameclass Announcement(models.Model):    id = models.IntegerField(primary_key=True)    title = models.CharField(max_length=100L , blank = False , verbose_name = "Title")    content = models.TextField( blank = False , verbose_name = "Content")    createddate = models.DateField(null=True, db_column='createdDate', blank=True , default=time.strftime('%Y-%m-%d'),verbose_name='Date')    class Meta:        db_table = u't_announcement'        verbose_name = u'announcement'        verbose_name_plural = u'announcement'        app_label = u'My_Company'class Products(models.Model):    id = models.IntegerField(primary_key=True)    catid = models.ForeignKey(ProductCategory,db_column= 'catid',to_field='id',blank=False,verbose_name = 'catid')     product_name = models.CharField(max_length=200L , verbose_name = "Name")    product_simple_desc = models.TextField(blank=True , verbose_name = "Simple Desc")    product_full_desc = models.TextField(blank=True , verbose_name = "Full Desc")    product_pic = models.CharField(max_length=200L, blank=True , verbose_name = "Picture Path")    product_order = models.IntegerField(verbose_name = "Order")    createddate = models.DateField(db_column='createdDate', blank=True , default=time.strftime('%Y-%m-%d') , verbose_name = "Created Date") # Field name made lowercase. This field type is a guess.    class Meta:        db_table = 't_products'        verbose_name = u'products'        verbose_name_plural = u'products'        app_label = u'My_Company'class News(models.Model):    id = models.AutoField(primary_key=True)    title = models.CharField(max_length=255L, blank=True ,verbose_name = "Title")    content = models.TextField(blank=True , verbose_name = "Content")    createddate = models.DateField(null=True, db_column='createdDate', blank=True , default=time.strftime('%Y-%m-%d') , verbose_name = "Created Date") # Field name made lowercase.    class Meta:        db_table = 't_news'        verbose_name = u'news'        verbose_name_plural = u'news'        app_label = u'My_Company'class Download(models.Model):    id = models.AutoField(primary_key=True)    catid = models.ForeignKey(DownloadCategory,db_column= 'catid',to_field='id',blank=False,verbose_name = 'catid')     title = models.CharField(max_length=150L, blank=True)    content = models.TextField(blank=True)    downloadurl = models.CharField(max_length=200L, blank=True)    createddate = models.DateField(null=True, db_column='createdDate', blank=True) # Field name made lowercase.    class Meta:        db_table = 't_download'        verbose_name = u'download'        verbose_name_plural = u'download'        app_label=u"My_Company"class Faq(models.Model):    id = models.AutoField(primary_key=True)    catid = models.ForeignKey(FaqCategory,db_column= 'catid',to_field='id',blank=False,verbose_name = 'catid')        title = models.CharField(max_length=150L, blank=True ,verbose_name = 'title')    content = models.TextField(blank=True,verbose_name = 'content')    class Meta:        db_table = 't_faq'        verbose_name = u'faq'        verbose_name_plural = u'faq'        app_label=u"My_Company"class Service(models.Model):    id = models.AutoField(primary_key=True)    catid = models.ForeignKey(ServiceCategory,db_column= 'catid',to_field='id',blank=False,verbose_name = 'catid')     title = models.CharField(max_length=150L, blank=True)    content = models.TextField(blank=True)    class Meta:        db_table = 't_service'        verbose_name = u'service'        verbose_name_plural = u'service'        app_label=u"My_Company"class About(models.Model):    id = models.AutoField(primary_key=True)    catid = models.ForeignKey(AboutCategory,db_column= 'catid',to_field='id',blank=False,verbose_name = 'catid')    title = models.CharField(max_length=150L, blank=True)    content = models.TextField(blank=True)    class Meta:        db_table = 't_about'        verbose_name = u'about'        verbose_name_plural = u'about'        app_label=u"My_Company"
013002iuqtvktpszt2txpg.jpg

013003txqhx077p2trl9lq.jpg

syncdb用了也创建不了。

免责声明:本内容仅代表回答会员见解不代表天盟观点,请谨慎对待。

版权声明:作者保留权利,不代表天盟立场。

使用道具 举报

发新帖

发布任务需求已有1031167位用户正在使用天盟网服务

发布分类: *
任务预算: *
需求内容: *
手机号码: *
任务商家报价为
  • 预算价 :
  • 成交价 :
  • 完工期 :
  • 质保期 :

* 最终任务项目以服务商报价、双方协商为准!