Re: Does Django detect changes in models Meta ?
I am new, just completed the tutorials, but from my understanding you run "python manage.py syncdb" and that rebuilds the tables etc. 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 the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@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/1083dee2-e8ec-451f-9ef9-1ebbc04c41af%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Does Django detect changes in models Meta ?
I believe so. Wont hurt to try it and see what happens. On Fri, Aug 22, 2014 at 11:03 AM, NĂ©stor wrote: > is that true if the table is already there? > > > On Fri, Aug 22, 2014 at 6:55 AM, Norman Bird > wrote: > >> I am new, just completed the tutorials, but from my understanding you run >> "python manage.py syncdb" and that rebuilds the tables etc. >> >> 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 the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django-users+unsubscr...@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/1083dee2-e8ec-451f-9ef9-1ebbc04c41af%40googlegroups.com >> <https://groups.google.com/d/msgid/django-users/1083dee2-e8ec-451f-9ef9-1ebbc04c41af%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- > 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+unsubscr...@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/CAON-vCMhSVSAXUsj6ROaXbYg5NzqYbUenz2VUmjHvRj%3Dghpwvw%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CAON-vCMhSVSAXUsj6ROaXbYg5NzqYbUenz2VUmjHvRj%3Dghpwvw%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- 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+unsubscr...@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_r61g335PLujL4DWcNziuDOWpacW%3DD185amZfFVAk7DhJrEw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: Does Django detect changes in models Meta ?
I stand corrected. :-) On Fri, Aug 22, 2014 at 11:47 AM, Larry Martell wrote: > On Fri, Aug 22, 2014 at 9:55 AM, Norman Bird > 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+unsubscr...@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 -- 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+unsubscr...@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_r61ipO%3DtPnmKe--ibKNn%2B1%2BhuShkTjpKshjKsDe0%3DLERuCw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
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 wrote: > I stand corrected. :-) > > > On Fri, Aug 22, 2014 at 11:47 AM, Larry Martell > wrote: > >> On Fri, Aug 22, 2014 at 9:55 AM, Norman Bird >> 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+unsubscr...@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+unsubscr...@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.
Re: Does Django detect changes in models Meta ?
OK, I found out that in order to change the schema of the tables one has to install and run a migration tool. I used south. just install south and check out their website for basic use and you basically run a few commands from the command line and it sees the changes you made and migrate the changes to your tables. I found that it does not work very well on sqlite3 Db, so I converted my DB to MYSQL and did that. Or find another migration tool other than south, but in order to update tables in Django, the easiest way is with a migration tool. And I found this all out via stackoverflow. :-) thanks On Fri, Aug 22, 2014 at 11:42 PM, Norman Bird wrote: > 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 > wrote: > >> I stand corrected. :-) >> >> >> On Fri, Aug 22, 2014 at 11:47 AM, Larry Martell >> wrote: >> >>> On Fri, Aug 22, 2014 at 9:55 AM, Norman Bird >>> 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+unsubscr...@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 > -- 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+unsubscr...@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_r61gA2tDtjhETuA4nN5AvzQOVah5Ygu4r5Z_8hV4_4m2k6g%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: Does Django detect changes in models Meta ?
Ok, I have version 1.6.5. I will see about updating. HmmmI had googled and this is the first im hearing of this. Got to love Django. :-) On Tuesday, September 2, 2014 5:40:52 PM UTC-4, Collin Anderson wrote: > > The newest version of django, version 1.7, has migrations built in. > -- 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+unsubscr...@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/dd441b8c-da8a-48e2-9f31-a9d29fec8ef8%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.