Re: How to fix "plural forms expression could be dangerous"

2017-05-21 Thread Martin Brochhaus
> On Thu, May 18, 2017 at 7:41 AM, Martin Brochhaus > > wrote: > > Hi everyone, > > > > in my project, I am generating my .po files like this: > > > > python manage.py makemessages --ignore=node_modules/* > --ignore=*migrations/* > > --ignore=*

How to fix "plural forms expression could be dangerous"

2017-05-18 Thread Martin Brochhaus
Hi everyone, in my project, I am generating my .po files like this: python manage.py makemessages --ignore=node_modules/* --ignore=*migrations/* --ignore=*tests/* --ignore=__init__.py --ignore=submodules/* --ignore=fabfile* -l zh_CN Usually this results in the following line being added to my

Aw: Re: Setting up dev/test/production environments on the server (dreamhost)

2011-06-04 Thread Martin Brochhaus
+1 Hosting 20 (or more) on Webfaction. Awesome service. Awesome speed. Peace of mind. Best regards, Martin -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/

Aw: Best CSS/JS compressor?

2011-06-02 Thread Martin Brochhaus
I'm using django_compressor and I am very happy with it! Best regards, Martin -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/eUlxYkp0NXdEQkVK. To post to

Aw: Reasons to use managers

2011-06-02 Thread Martin Brochhaus
>From the documentation: Adding extra Manager methods is the preferred way to add "table-level" functionality to your models. (For "row-level" functionality -- i.e., functions that act on a single instance of a model object -- use *Model methods*

Aw: Internationalization in Django.

2011-06-02 Thread Martin Brochhaus
There are dozens of approaches for this: http://djangopackages.com/grids/g/model-translation/ Most of them are old, not documented, outdated, abandonned or just slow. The newest player in this field is django-nani and I would recommend you to give it a try! Best regards, Martin -- You receive

Aw: How to unit test if user has access to page

2011-04-16 Thread Martin Brochhaus
Also beware! Only do a client.post if you really want to test that a user submits a form. Usually when a not-logged-in-user wants to go to a secured page immediately he will try a get request and just enter the URL. Sometimes your view behaves differently on get and on post (most of the times) s

Extend admin template without copying the whole template

2011-02-27 Thread Martin Brochhaus
Hi all, I want to add a language switcher below the breadcrumb to all my django admin pages. Therefore I created templates/admin/base.html in my project. However I don't want to copy the whole original base.html and add my changes - this would defeat the DRY principle and it would be a mainten

For loop over integers rather than list within Django template

2009-04-17 Thread Martin Brochhaus
A while ago I needed a loop like "for(int i=0; i<20; i++)" within a Django template. Since the builtin for-loop only iterates over lists and since there was no appropriate template filter, I created a custom one. To me it seems as if this technique isn't well known to many users as you can see he