Show More
@@ -0,0 +1,30 b'' | |||
|
1 | # -*- coding: utf-8 -*- | |
|
2 | from __future__ import unicode_literals | |
|
3 | ||
|
4 | from django.db import models, migrations | |
|
5 | ||
|
6 | ||
|
7 | class Migration(migrations.Migration): | |
|
8 | ||
|
9 | dependencies = [ | |
|
10 | ('boards', '0012_thread_max_posts'), | |
|
11 | ] | |
|
12 | ||
|
13 | operations = [ | |
|
14 | migrations.RemoveField( | |
|
15 | model_name='post', | |
|
16 | name='poster_user_agent', | |
|
17 | ), | |
|
18 | migrations.AlterField( | |
|
19 | model_name='post', | |
|
20 | name='title', | |
|
21 | field=models.CharField(null=True, blank=True, max_length=200), | |
|
22 | preserve_default=True, | |
|
23 | ), | |
|
24 | migrations.AlterField( | |
|
25 | model_name='thread', | |
|
26 | name='max_posts', | |
|
27 | field=models.IntegerField(default=12), | |
|
28 | preserve_default=True, | |
|
29 | ), | |
|
30 | ] |
@@ -38,9 +38,6 b' TITLE_MAX_LENGTH = 200' | |||
|
38 | 38 | # TODO This should be removed |
|
39 | 39 | NO_IP = '0.0.0.0' |
|
40 | 40 | |
|
41 | # TODO Real user agent should be saved instead of this | |
|
42 | UNKNOWN_UA = '' | |
|
43 | ||
|
44 | 41 | REGEX_REPLY = re.compile(r'\[post\](\d+)\[/post\]') |
|
45 | 42 | REGEX_NOTIFICATION = re.compile(r'\[user\](\w+)\[/user\]') |
|
46 | 43 | |
@@ -89,8 +86,6 b' class PostManager(models.Manager):' | |||
|
89 | 86 | pub_time=posting_time, |
|
90 | 87 | poster_ip=ip, |
|
91 | 88 | thread=thread, |
|
92 | poster_user_agent=UNKNOWN_UA, # TODO Get UA at | |
|
93 | # last! | |
|
94 | 89 | last_edit_time=posting_time) |
|
95 | 90 | post.threads.add(thread) |
|
96 | 91 | |
@@ -158,7 +153,7 b' class Post(models.Model, Viewable):' | |||
|
158 | 153 | app_label = APP_LABEL_BOARDS |
|
159 | 154 | ordering = ('id',) |
|
160 | 155 | |
|
161 | title = models.CharField(max_length=TITLE_MAX_LENGTH) | |
|
156 | title = models.CharField(max_length=TITLE_MAX_LENGTH, null=True, blank=True) | |
|
162 | 157 | pub_time = models.DateTimeField() |
|
163 | 158 | text = TextField(blank=True, null=True) |
|
164 | 159 | _text_rendered = TextField(blank=True, null=True, editable=False) |
@@ -167,7 +162,6 b' class Post(models.Model, Viewable):' | |||
|
167 | 162 | related_name='ip+', db_index=True) |
|
168 | 163 | |
|
169 | 164 | poster_ip = models.GenericIPAddressField() |
|
170 | poster_user_agent = models.TextField() | |
|
171 | 165 | |
|
172 | 166 | last_edit_time = models.DateTimeField() |
|
173 | 167 |
General Comments 0
You need to be logged in to leave comments.
Login now