1. Michael Manfre
  2. django-textpattern

Commits

Michael Manfre  committed 357cacf Draft

Correct CharField lengths

  • Participants
  • Parent commits be1ad5e
  • Branches default

Comments (0)

Files changed (1)

File textpattern/models.py

View file
     id = models.AutoField(primary_key=True, db_column='ID')
     posted = models.DateTimeField(db_column='Posted', auto_now_add=True)
     expires = models.DateTimeField(db_column='Expires', default=datetime.datetime(9999, 1, 1))
-    authorid = models.CharField(max_length=192, db_column='AuthorID')
+    authorid = models.CharField(max_length=64, db_column='AuthorID')
     lastmod = models.DateTimeField(db_column='LastMod', default=datetime.datetime.now)
-    lastmodid = models.CharField(max_length=192, db_column='LastModID')
-    title = models.CharField(max_length=765, db_column='Title')
-    title_html = models.CharField(max_length=765, db_column='Title_html')
+    lastmodid = models.CharField(max_length=64, db_column='LastModID')
+    title = models.CharField(max_length=255, db_column='Title')
+    title_html = models.CharField(max_length=255, db_column='Title_html')
     body = models.TextField(db_column='Body')
     body_html = models.TextField(db_column='Body_html')
     excerpt = models.TextField(db_column='Excerpt')
     excerpt_html = models.TextField(db_column='Excerpt_html')
-    image = models.CharField(max_length=765, db_column='Image')
-    category1 = models.CharField(max_length=384, db_column='Category1')
-    category2 = models.CharField(max_length=384, db_column='Category2')
+    image = models.CharField(max_length=255, db_column='Image')
+    category1 = models.CharField(max_length=128, db_column='Category1')
+    category2 = models.CharField(max_length=128, db_column='Category2')
     annotate = models.IntegerField(db_column='Annotate', default=0)
-    annotateinvite = models.CharField(max_length=765, db_column='AnnotateInvite')
+    annotateinvite = models.CharField(max_length=255, db_column='AnnotateInvite')
     comments_count = models.IntegerField(default=0)
     status = models.IntegerField(db_column='Status', 
         choices=ARTICLE_STATUS_CHOICES, default=ARTICLE_STATUS_DRAFT)
     textile_body = models.IntegerField(default=0)
     textile_excerpt = models.IntegerField(default=0)
-    section = models.CharField(max_length=192, db_column='Section')
-    override_form = models.CharField(max_length=765)
-    keywords = models.CharField(max_length=765, db_column='Keywords')
-    url_title = models.CharField(max_length=765)
-    custom_1 = models.CharField(max_length=765)
-    custom_2 = models.CharField(max_length=765)
-    custom_3 = models.CharField(max_length=765)
-    custom_4 = models.CharField(max_length=765)
-    custom_5 = models.CharField(max_length=765)
-    custom_6 = models.CharField(max_length=765)
-    custom_7 = models.CharField(max_length=765)
-    custom_8 = models.CharField(max_length=765)
-    custom_9 = models.CharField(max_length=765)
-    custom_10 = models.CharField(max_length=765)
-    uid = models.CharField(max_length=96)
+    section = models.CharField(max_length=64, db_column='Section')
+    override_form = models.CharField(max_length=255)
+    keywords = models.CharField(max_length=255, db_column='Keywords')
+    url_title = models.CharField(max_length=255)
+    custom_1 = models.CharField(max_length=255)
+    custom_2 = models.CharField(max_length=255)
+    custom_3 = models.CharField(max_length=255)
+    custom_4 = models.CharField(max_length=255)
+    custom_5 = models.CharField(max_length=255)
+    custom_6 = models.CharField(max_length=255)
+    custom_7 = models.CharField(max_length=255)
+    custom_8 = models.CharField(max_length=255)
+    custom_9 = models.CharField(max_length=255)
+    custom_10 = models.CharField(max_length=255)
+    uid = models.CharField(max_length=32)
     feed_time = models.DateField(auto_now_add=True)
 
     objects = ArticleManager()
 
 class TxpCategory(models.Model):
     id = models.IntegerField(primary_key=True)
-    name = models.CharField(max_length=192)
-    type = models.CharField(max_length=192)
-    parent = models.CharField(max_length=192)
+    name = models.CharField(max_length=64)
+    type = models.CharField(max_length=64)
+    parent = models.CharField(max_length=64)
     lft = models.IntegerField()
     rgt = models.IntegerField()
-    title = models.CharField(max_length=765)
+    title = models.CharField(max_length=255)
 
     class Meta:
         db_table = u'txp_category'
 
 class TxpCss(models.Model):
-    name = models.CharField(primary_key=True, max_length=765, unique=True)
+    name = models.CharField(primary_key=True, max_length=255, unique=True)
     css = models.TextField()
 
     class Meta:
 class TxpDiscuss(models.Model):
     discussid = models.IntegerField(primary_key=True)
     parentid = models.IntegerField()
-    name = models.CharField(max_length=765)
-    email = models.CharField(max_length=150)
-    web = models.CharField(max_length=765)
-    ip = models.CharField(max_length=300)
+    name = models.CharField(max_length=255)
+    email = models.CharField(max_length=50)
+    web = models.CharField(max_length=255)
+    ip = models.CharField(max_length=100)
     posted = models.DateTimeField()
     message = models.TextField()
     visible = models.IntegerField(choices=DISCUSS_VISIBLE_CHOICES)
         db_table = u'txp_discuss'
 
 class TxpDiscussIpban(models.Model):
-    ip = models.CharField(max_length=765, primary_key=True)
-    name_used = models.CharField(max_length=765)
+    ip = models.CharField(max_length=255, primary_key=True)
+    name_used = models.CharField(max_length=255)
     date_banned = models.DateTimeField()
     banned_on_message = models.IntegerField()
 
 
 class TxpDiscussNonce(models.Model):
     issue_time = models.DateTimeField()
-    nonce = models.CharField(max_length=765, primary_key=True)
+    nonce = models.CharField(max_length=255, primary_key=True)
     used = models.IntegerField()
-    secret = models.CharField(max_length=765)
+    secret = models.CharField(max_length=255)
 
     class Meta:
         db_table = u'txp_discuss_nonce'
 
 class TxpFile(models.Model):
     id = models.IntegerField(primary_key=True)
-    filename = models.CharField(max_length=765, unique=True)
-    title = models.CharField(max_length=765, blank=True)
-    category = models.CharField(max_length=765)
-    permissions = models.CharField(max_length=96)
+    filename = models.CharField(max_length=255, unique=True)
+    title = models.CharField(max_length=255, blank=True)
+    category = models.CharField(max_length=255)
+    permissions = models.CharField(max_length=32)
     description = models.TextField()
     downloads = models.IntegerField()
     status = models.IntegerField(choices=FILE_STATUS_CHOICES)
     modified = models.DateTimeField()
     created = models.DateTimeField()
     size = models.BigIntegerField(null=True, blank=True)
-    author = models.CharField(max_length=765)
+    author = models.CharField(max_length=255)
 
     class Meta:
         db_table = u'txp_file'
 
 class TxpForm(models.Model):
-    name = models.CharField(max_length=192, primary_key=True)
-    type = models.CharField(max_length=84)
+    name = models.CharField(max_length=64, primary_key=True)
+    type = models.CharField(max_length=28)
     form = models.TextField(db_column='Form')
 
     class Meta:
 
 class TxpImage(models.Model):
     id = models.IntegerField(primary_key=True)
-    name = models.CharField(max_length=765)
-    category = models.CharField(max_length=765)
-    ext = models.CharField(max_length=60)
+    name = models.CharField(max_length=255)
+    category = models.CharField(max_length=255)
+    ext = models.CharField(max_length=20)
     w = models.IntegerField()
     h = models.IntegerField()
-    alt = models.CharField(max_length=765)
+    alt = models.CharField(max_length=255)
     caption = models.TextField()
     date = models.DateTimeField()
-    author = models.CharField(max_length=765)
+    author = models.CharField(max_length=255)
     thumbnail = models.IntegerField()
     thumb_w = models.IntegerField()
     thumb_h = models.IntegerField()
 
 class TxpLang(models.Model):
     id = models.IntegerField(primary_key=True)
-    lang = models.CharField(max_length=48)
-    name = models.CharField(max_length=192, unique=True)
-    event = models.CharField(max_length=192)
+    lang = models.CharField(max_length=16)
+    name = models.CharField(max_length=64, unique=True)
+    event = models.CharField(max_length=64)
     data = models.TextField(blank=True)
     lastmod = models.DateTimeField()
 
 class TxpLink(models.Model):
     id = models.IntegerField(primary_key=True)
     date = models.DateTimeField()
-    category = models.CharField(max_length=192)
+    category = models.CharField(max_length=64)
     url = models.TextField()
-    linkname = models.CharField(max_length=765)
-    linksort = models.CharField(max_length=384)
+    linkname = models.CharField(max_length=255)
+    linksort = models.CharField(max_length=128)
     description = models.TextField()
-    author = models.CharField(max_length=765)
+    author = models.CharField(max_length=255)
 
     class Meta:
         db_table = u'txp_link'
 class TxpLog(models.Model):
     id = models.IntegerField(primary_key=True)
     time = models.DateTimeField()
-    host = models.CharField(max_length=765)
-    page = models.CharField(max_length=765)
+    host = models.CharField(max_length=255)
+    page = models.CharField(max_length=255)
     refer = models.TextField()
     status = models.IntegerField()
-    method = models.CharField(max_length=48)
-    ip = models.CharField(max_length=48)
+    method = models.CharField(max_length=16)
+    ip = models.CharField(max_length=16)
 
     class Meta:
         db_table = u'txp_log'
 
 class TxpPage(models.Model):
-    name = models.CharField(max_length=384, primary_key=True)
+    name = models.CharField(max_length=128, primary_key=True)
     user_html = models.TextField()
 
     class Meta:
         db_table = u'txp_page'
 
 class TxpPlugin(models.Model):
-    name = models.CharField(max_length=192, unique=True, primary_key=True)
+    name = models.CharField(max_length=64, unique=True, primary_key=True)
     status = models.IntegerField()
-    author = models.CharField(max_length=384)
-    author_uri = models.CharField(max_length=384)
+    author = models.CharField(max_length=128)
+    author_uri = models.CharField(max_length=128)
     version = models.CharField(max_length=30)
     description = models.TextField()
     help = models.TextField()
     code = models.TextField()
     code_restore = models.TextField()
-    code_md5 = models.CharField(max_length=96)
+    code_md5 = models.CharField(max_length=32)
     type = models.IntegerField()
     load_order = models.IntegerField()
     flags = models.IntegerField()
 
 class TxpPrefs(models.Model):
     prefs_id = models.IntegerField(unique=True)
-    name = models.CharField(max_length=765, primary_key=True)
+    name = models.CharField(max_length=255, primary_key=True)
     val = models.TextField()
     type = models.IntegerField()
-    event = models.CharField(max_length=36)
-    html = models.CharField(max_length=192)
+    event = models.CharField(max_length=12)
+    html = models.CharField(max_length=64)
     position = models.IntegerField()
-    user_name = models.CharField(max_length=192)
+    user_name = models.CharField(max_length=64)
 
     class Meta:
         db_table = u'txp_prefs'
         return prefs.get(name, None)
 
 class TxpSection(models.Model):
-    name = models.CharField(max_length=384, primary_key=True)
-    page = models.CharField(max_length=384)
-    css = models.CharField(max_length=384)
+    name = models.CharField(max_length=128, primary_key=True)
+    page = models.CharField(max_length=128)
+    css = models.CharField(max_length=128)
     in_rss = models.IntegerField(default=0)
     on_frontpage = models.IntegerField(default=0)
     searchable = models.IntegerField(default=0)
-    title = models.CharField(max_length=765)
+    title = models.CharField(max_length=255)
 
     class Meta:
         db_table = u'txp_section'
 
 class TxpUser(models.Model):
     user_id = models.AutoField(primary_key=True)
-    username = models.CharField(max_length=192, unique=True, db_column='name')
-    password = models.CharField(max_length=384, db_column='pass')
-    realname = models.CharField(max_length=765, db_column='RealName')
+    username = models.CharField(max_length=64, unique=True, db_column='name')
+    password = models.CharField(max_length=128, db_column='pass')
+    realname = models.CharField(max_length=255, db_column='RealName')
     email = models.CharField(max_length=762)
     privs = models.IntegerField(default=PRIVS_NONE)
     last_access = models.DateTimeField(auto_now_add=True)
-    nonce = models.CharField(max_length=192)
+    nonce = models.CharField(max_length=64)
 
     class Meta:
         db_table = u'txp_users'