Hi,
I am very sorry, but I don't understand russian. Can you answer me in english? And I am using Python 3.4.
Dne 26. 12. 2014 14:30 "Валерий Бовсуновский" <id290573@gmail.com> napsal(a):
-- --
четверг, 25 декабря 2014 г., 18:06:35 UTC+3 пользователь Robert Jonathan Šimon написал:Hi,When i googled for this problem a found out, that with migrations in Django 1.7, there is new way how it should be done, but i didnt understand it how. Can anyone explain me the new way how to do it?Thanks a lot.python2.7 manage.py makemigrationspython2.7 manage.py migratemakemigrations - проверяет есть ли новые таблицыmigrate - создает таблицы или удаляетНапишите модель простую что бы протестироватьclass Home(models.Model):
title = models.CharField(max_length=150)
text = models.TextField(blank=True, null=True)
date = models.DateTimeField(blank=True, null=True)
def __unicode__(self):
return self.titleпроведите две командыpython2.7 manage.py makemigrationspython2.7 manage.py migrateПотом закомментируйте одну строкуclass Home(models.Model):
title = models.CharField(max_length=150)
#text = models.TextField(blank=True, null=True)
date = models.DateTimeField(blank=True, null=True)
def __unicode__(self):
return self.titleИ опять две командыpython2.7 manage.py makemigrationspython2.7 manage.py migrateполе удалится#text = models.TextField(blank=True, null=True)Что бы не было ошибок нужно всегда заполнять blank=True, null=True, смотреть документацию, иначе выдаст варианты.
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/9i7Cf5ksaeE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/dbd118f7-2410-4755-958f-c1e63f33ad56%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALsvucLRK_dCZk6YC9%2BCr6cQs3BgDqewfZ7X8kXZ%2Bwf6VzPLTw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment