Re: SQL statement runs in a loop

2010-02-04 Thread äL
On 4 Feb., 11:48, Daniel Roseman <dan...@roseman.org.uk> wrote: > On Feb 4, 6:23 am, äL <lamberto.gri...@gmail.com> wrote: > > > I have an SQL statement in views.py: > > > karatekas = Karateka.objects.extra(where = ["bsc = 1 OR skr = > > 1"]).sel

SQL statement runs in a loop

2010-02-03 Thread äL
I have an SQL statement in views.py: karatekas = Karateka.objects.extra(where = ["bsc = 1 OR skr = 1"]).select_related() This statement runs in a loop an no data will come back. If I change the little word "OR" to "AND", karatekas = Karateka.objects.extra(where = ["bsc = 1 AND skr =

Re: How to select all the values from my Field attribute 'choices?

2007-11-27 Thread äL
I get all values? From a table it's easy: Just type "nations = Country.objects.all()" With a choice-list "objects.all()" doesn't work. äL On 8 Nov., 13:42, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > On 11/8/07, äL <[EMAIL PROTECTED]> wrote: &

Re: How to select all the values from my Field attribute 'choices?

2007-11-08 Thread äL
' ### END CODE ### Do I have an error in the import syntax? How can I import ROLE? Thanks for your help regards, äL On 6 Nov., 21:27, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On 11/6/07, äL <[EMAIL PROTECTED]> wrote: > > > > > > > Hello Karen >

Re: How to select all the values from my Field attribute 'choices?

2007-11-06 Thread äL
: roles, 'user' : request.user}) ### END CODE ### Do I need to import ROLE like Karateka or do I have an other error in my code? Regards, äL On 24 Okt., 00:06, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On 10/23/07, Greg <[EMAIL PROTECT

Re: Customize Admin Object elements

2007-10-31 Thread äL
I would like to do the same. But if I try class Meta: ordering = ['name'] the drop down menu is still ordered by ID and not by name. Because name is in an other model (foreign key). This is my code: ### CODE ### class Person(models.Model): nameLast = models.CharField

Re: save() datefield

2007-10-31 Thread äL
Guettler <[EMAIL PROTECTED]> wrote: > Am Freitag, 26. Oktober 2007 10:53 schrieb äL: > > > I use Django to manage addresses. To publish the data I have a list > > and a detailed view. In the detail view I can change the name, > > address, phone, etc. of the person. To do t

save() datefield

2007-10-26 Thread äL
I use Django to manage addresses. To publish the data I have a list and a detailed view. In the detail view I can change the name, address, phone, etc. of the person. To do that I created an edit form. Now, everythin is fine. Only if I try to change and save the birthday (witch is a datefield)

Ordering by foreign key, class Meta

2007-10-19 Thread äL
I would like to order a list in a view by foreign key. If I try ordering how in the code below my list is ordered by 'person'. And this means that the list ist ordered by the ID of the table Person. But I need a list ordered by 'nameLast'. Thus I changed ordering 'person' into 'person.nameLast'.

Re: Check if user is a member of group in template

2007-10-10 Thread äL
> > http://www.djangosnippets.org/snippets/282/ > > On Oct 9, 3:22 am, äL <[EMAIL PROTECTED]> wrote: > > > Inhttp://code.djangoproject.com/wiki/CookBookRequiredGroupLoginI > > found how > > to show a template only if the user is in a specific group (admin). > > > Now

Check if user is a member of group in template

2007-10-09 Thread äL
In http://code.djangoproject.com/wiki/CookBookRequiredGroupLogin I found how to show a template only if the user is in a specific group (admin). Now I would like to do the same in a template. How can I hide a link, for example, if the user is not in the admin group? I'm looking for something