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
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
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
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
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
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
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
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
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
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
10 matches
Mail list logo