Django Philosophy and Queries

2020-06-11 Thread Yves de Champlain
Hi I am wondering at some ways one can write a query in Django. Let's say for example : Whatever.objects.filter(fk_object_id=fk_object_id) Whatever.objects.filter(fk_object_id=fk_object.id) Whatever.objects.filter(fk_object=fk_object) and I could add to that list fk_object__id and

Re: Impossible d'utiliser language_code 'fr-fr' avec django 3.0.4

2020-03-27 Thread Yves de Champlain
J'abonde dans le sens de Simon, mais il me semble y avoir une confusion entre le code de langage 'fr' et le code de locale 'fr_FR' J'en profite pour soulever la question parce que même si mon projet fonctionne (et que j'ai fait le tour de la documentation) ce point dans Django demeure obscur

Re: Problem with migrations order

2020-03-24 Thread Yves de Champlain
ure you tell django that you have make changes the by running this > python manage.py makemigrations > after that > enter python manage.py migrate > it will automatically update your database > > > On Tuesday, March 24, 2020 at 7:36:31 PM UTC+14, Yves de Champlain wrote: &g

Problem with migrations order

2020-03-23 Thread Yves de Champlain
Hi I added a new app 'portfolio' in my project, but since then migrations won't work anymore because Django seems to be trying to do them in the wrong order. *Running migrations:* Applying core.0001_initial...* OK* Applying contenttypes.0001_initial...* OK* Applying

Re: get_FOO_display not working ?

2020-02-23 Thread Yves de Champlain
to finalize the list prior to running migrate. > > Not much help I know > > Good luck > > Mike > > Original message > From: Yves de Champlain > Date: 23/2/20 15:47 (GMT+10:00) > To: Django users > Subject: get_FOO_display not wor

Re: get_FOO_display not working ?

2020-02-23 Thread Yves de Champlain
Hi Actually, the human readable value is not (‘Draft’) but _(‘Draft’) which is shorthand for gettext_lazy(‘Draft’) Yves > Le 22 févr. 2020 à 23:54, Nde Nguti a écrit : > > CHOICES =(('draft', 'Draft'), ) > > On Sun, Feb 23, 2020, 05:48 Yves de Champlain <mailto:yesy...

get_FOO_display not working ?

2020-02-22 Thread Yves de Champlain
Hi I'm using StatusModel from models_utils : class MetaData(TimeStampedModel, StatusModel, SoftDeletableModel): STATUS = Choices(('draft', _('Draft')), ('submitted', _('Submitted')), ('underreview', _('Underreview')), ) Forms

Re: makemessages fails

2020-02-13 Thread Yves de Champlain
var-DJANGO_SETTINGS_MODULE> environment variable included in manage,py. Thanks for your help ! yves Le jeudi 13 février 2020 00:20:54 UTC-5, Yash Garg a écrit : > > Go through i18n official documentation and specify path according to that. > > On Thu 13 Feb, 2020, 10:25 AM Yves de C

Re: makemessages fails

2020-02-12 Thread Yves de Champlain
; Have you specified path to Locale directory in settings.py? > > On Wednesday, February 12, 2020 at 7:51:53 PM UTC+5:30, Yves de Champlain > wrote: >> >> Hi >> >> When I run >> >> django-admin makemessages -l fr >> >> I get >> >>

makemessages fails

2020-02-12 Thread Yves de Champlain
Hi When I run django-admin makemessages -l fr I get Traceback (most recent call last): File "/opt/miniconda3/envs/cert_tool/lib/python3.7/site-packages/django/core/management/base.py" , line 323, in run_from_argv self.execute(*args, **cmd_options) File

Re: LANGUAGE_CODE

2019-08-10 Thread Yves de Champlain
is possible to not use cookies at all regarding i18n if you use > language code as part of URL. I always prefer using URL for i18n. > > On Mon, Jul 29, 2019 at 1:08 AM Yves de Champlain > wrote: > >> HI >> >> Django translation works very well for me, excep

ji18n question

2019-08-01 Thread Yves de Champlain
Hi I have this error : File "/opt/miniconda/envs/cert_tool/lib/python3.7/gettext.py" in _tokenize 93. raise ValueError('invalid token in plural form: %s' % value) Exception Type: ValueError at /editor/jsi18n/ Exception Value: invalid token in plural form: EXPRESSION The problem

Re: LANGUAGE_CODE

2019-07-29 Thread Yves de Champlain
s prefer using URL for i18n. > > On Mon, Jul 29, 2019 at 1:08 AM Yves de Champlain <mailto:yesy...@gmail.com>> wrote: > HI > > Django translation works very well for me, except that when I try to change > LANGUAGE_CODE in settings.py, my site remains in French. I n

LANGUAGE_CODE

2019-07-28 Thread Yves de Champlain
HI Django translation works very well for me, except that when I try to change LANGUAGE_CODE in settings.py, my site remains in French. I need to change my OS system settings to see the English version. I have two languages, English as default and a French Translation. LANGUAGES = (

Re: Using a 2-dimensional array in a template

2019-07-18 Thread Yves de Champlain
That looks just perfect ! I knew but I see I still need to learn more about data structures in Python. Thanks a lot ! yves Le jeudi 18 juillet 2019 15:29:48 UTC-4, Daniel Roseman a écrit : > > On Thursday, 18 July 2019 15:56:59 UTC+1, Yves de Champlain wrote: >> >> Indeed,

Using a 2-dimensional array in a template

2019-07-16 Thread Yves de Champlain
Hi I'm pretty new to Django. I like it a lot but there seems to be no straightforward way to use a 2-dimensional array in a template, something that might look like this : {% for skill in skills %} {{ skill.name }} {% for achievement in achievements %} {{