Re: django 1.9, migrations SUCK

2016-08-03 Thread ludovic coues
Or, you could read either this thread or the doc and take advantage of the django taking care of you. Quoting the doc: "If the [choice] argument is a callable, it is evaluated each time the field’s form is initialized." That's why I suggested to add "lambda: " before the list comprehension. To

Re: django 1.9, migrations SUCK

2016-08-03 Thread Tom Christie
I'd suggest using `country = forms.ChoiceField(choices=[])` in the form declaration itself, and having the form `__init__()` method populate the *actual* set of choices. That way the allowable set of choices will always reflect whats currently in the DB at the point that the view runs. -- You

Re: django 1.9, migrations SUCK

2016-08-03 Thread 'Tom Evans' via Django users
On Fri, Jul 29, 2016 at 9:19 PM, Aztrock wrote: > Excellent, thanks > > This method i use from django 1.4, never have problem. > Apart from having to restart your application server each time you added a country, sure, no problems. Cheers Tom -- You received this

Re: django 1.9, migrations SUCK

2016-07-29 Thread Aztrock
Excellent, thanks This method i use from django 1.4, never have problem. 2016-07-29 11:36 GMT-05:00 ludovic coues : > In /home/ariatel_web/dashboard.ariatel.com.co/apps/did/forms.py, replacing > country = forms.ChoiceField(choices=[ (d.country_name, > d.country_name) for

Re: django 1.9, migrations SUCK

2016-07-29 Thread ludovic coues
In /home/ariatel_web/dashboard.ariatel.com.co/apps/did/forms.py, replacing country = forms.ChoiceField(choices=[ (d.country_name, d.country_name) for d in DidCountry.objects.filter(is_active=True) ] with country = forms.ChoiceField(choices=lambda: [ (d.country_name, d.country_name) for d

Re: django 1.9, migrations SUCK

2016-07-29 Thread Vijay Khemlani
File "/home/ariatel_web/dashboard.ariatel.com.co/apps/did/forms.py", line 12, in BuySearchForm country = forms.ChoiceField(choices=[ (d.country_name, d.country_name) for d in DidCountry.objects.filter(is_active=True) ], required=False) Theres your problem, you are trying to query the

Re: django 1.9, migrations SUCK

2016-07-29 Thread Jorge Cadena
Traceback (most recent call last): File "manage.py", line 10, in execute_from_command_line(sys.argv) File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 353, in execute_from_command_line utility.execute() File

Re: django 1.9, migrations SUCK

2016-07-29 Thread Jorge Cadena
same error, in mariaDB, postgresql, rigth now in sqlite3 El viernes, 29 de julio de 2016, 9:07:33 (UTC-5), Jorge Cadena escribió: > > Hi, > > I am dev in django at last 4 years, i missed ./manage.py syncdb, > > Delete all tables from databases (MariaDB, PostgreSQL) command line from > DB, and

Re: django 1.9, migrations SUCK

2016-07-29 Thread Michal Petrucha
On Fri, Jul 29, 2016 at 07:02:44AM -0700, Jorge Cadena wrote: > Hi, > > I am dev in django at last 4 years, i missed ./manage.py syncdb, > > Delete all tables from databases (MariaDB, PostgreSQL) command line from > DB, and run python manage.py migrate always same error > > *python manage.py

django 1.9, migrations SUCK

2016-07-29 Thread Jorge Cadena
Hi, I am dev in django at last 4 years, i missed ./manage.py syncdb, Delete all tables from databases (MariaDB, PostgreSQL) command line from DB, and run python manage.py migrate always same error *python manage.py migrate* django.db.utils.ProgrammingError: (1146, "Table