Friday, August 22, 2014

Re: Does Django detect changes in models Meta ?

how about: python manage.py sql myapp 
I just changed my model and I had to runt that in order to build the tables. 


On Fri, Aug 22, 2014 at 11:49 AM, Norman Bird <steelpulsefan@gmail.com> wrote:
I stand corrected. :-) 


On Fri, Aug 22, 2014 at 11:47 AM, Larry Martell <larry.martell@gmail.com> wrote:
On Fri, Aug 22, 2014 at 9:55 AM, Norman Bird <steelpulsefan@gmail.com> wrote:
> I am new, just completed the tutorials, but from my understanding you run
> "python manage.py syncdb" and that rebuilds the tables etc.

No, syncdb only create tables that do not exist. It does not alter any
existing tables.

>
> On Friday, August 22, 2014 3:32:43 AM UTC-4, termopro wrote:
>>
>> Hi there,
>>
>> I am using Django 1.7 RC2.
>> I have created models and have run all the migrations so Django created
>> tables in database.
>> Now i decided to change database table names and have added Meta class to
>> models containing table name:
>>
>> class SomeModel(models.Model):
>>    ...
>>    class Meta:
>>       db_table = 'newname'
>>
>> Now when i run "makemigrations" Django doesn't detect any changes in
>> models:
>> "No changes detected in app 'blabla'."
>> As far as i understand the logic, Django should change table names from
>> 'appname_somemodel" to "newname".
>>
>> Is this an expected behavior or i am missing something?

--
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/Yj6Guv0ch5k/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/CACwCsY6SXWrzFVthSXGEMGbF2UmVaP1dMiO%2ByDc1W8Qy_28OSQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Thank You,

Norman Bird
Principal Web Development Consultant
DatabaseInDays.com
(703) 986-7157




--
Thank You,

Norman Bird
Principal Web Development Consultant
DatabaseInDays.com
(703) 986-7157

--
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/CAH_r61hgBCSvR_Zhur-qZJ3qTe-wsr%3D64%3DkU2tpDNuOK2mgp3g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment