Sorting multi-level categories

2010-01-16 Thread Nianbig
Hi, I´m using this code todo a multi-level category Django-app: http://code.djangoproject.com/wiki/CookBookCategoryDataModelPostMagic However, I would like to sort these in alphabetical order on the parents first and then the childs... how can I do this? I have tried various settings for

Re: Sorting list of objets in Python/Django

2008-09-21 Thread Nianbig
Ah, thanks! /Nianbig On 21 Sep, 19:45, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Nianbig wrote: > > I have a people-list like this: > >>>> class a: > > ...     def __init__(self, name, number): > > ...             self.name = name > > ...  

Sorting list of objets in Python/Django

2008-09-21 Thread Nianbig
a('Guran', 9432) ) >>> b.append( a('Asdf', 12) ) How do I sort this on their names e.g. ascending? I have tried b.sort() and so on in all sorts of ways but I can´t figure this one out.. Would be thankful for help. /Nianbig --~--~-~--~~~---~--~

Sort order of objects returned by ManyToManyField in admin

2008-09-11 Thread Nianbig
) or can I add some function to my category-model to handle this? Thanks in advance. /Nianbig --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send e

Project structure

2008-06-30 Thread Nianbig
my Django-project to be available in all templates without the need to define the functions for every view. Is this what middleware are for? Would be thankful for any tip/advice. /Nianbig --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: sort order

2008-01-31 Thread Nianbig
On 31 Jan, 16:52, "Jacob Kaplan-Moss" <[EMAIL PROTECTED]> wrote: > On 1/31/08, Nianbig <[EMAIL PROTECTED]> wrote: > > > I would like to add the functionality to be able to manually sort > > these objects in the Django-admin... I´ve tried doin

sort order

2008-01-31 Thread Nianbig
in the Django-admin... I´ve tried doing this by just adding a integerfield... but it is not so user friendly... are there any built-in functions for this in Django ? Thanks in advance! /Nianbig --~--~-~--~~~---~--~~ You received this message because you

Re: admin urls in my own admin view

2008-01-03 Thread Nianbig
t; %} {{ book }} {% endfor %} {% endfor %} {% endblock %} On Jan 3, 1:44 am, Nianbig <[EMAIL PROTECTED]> wrote: > Hi > > I´m building my own admin view... I have followed this > tutorial:http://www.djangobook.com/en/1.0/chapter17/. Everything works fine >

admin urls in my own admin view

2008-01-02 Thread Nianbig
Hi I´m building my own admin view... I have followed this tutorial: http://www.djangobook.com/en/1.0/chapter17/. Everything works fine except that all urls in the header, the "home" link, "change password" link, "logout" link doesn't work for some reasen. The home-link is linked to "/", not

Re: import problems

2007-12-15 Thread Nianbig
Problem solved.. The problem seemed to be that I had two models called "events" in "events.event.views.events.index".. after renaming the one of the modules and deleteing a events.pyc-file that had been auto-created it works fine again! /Nianbig On Dec 16, 12:27 am, Nianb

Re: import problems

2007-12-15 Thread Nianbig
(r'^events/$', 'events.event.views.events.index'), (r'^events/add/$', 'events.event.views.add.index'), (r'^events/add/save/$', 'events.event.views.add.save'), (r'^events/register/(?P\d+)/', 'events.event.views.register.register'), ) Thank you. /Nianbig On Dec 16, 12:15 am, Nianbig <[EM

Re: import problems

2007-12-15 Thread Nianbig
I´m having the same problem as well... Yes, permissions are set so that the web server has access to read the entire directory tree. /Nianbig On Dec 14, 3:53 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > Are the permissions set so that the web server has access to rea

Re: Admin selectbox for ForeignKey

2007-12-14 Thread Nianbig
Works perfect! Thank you! /Nianbig On Dec 14, 3:48 pm, Magnus B <[EMAIL PROTECTED]> wrote: > 1. Try adding blank=True as well > 2. You need to tell django what to output. Do this by defining a > __unicode__ method in the class News such as: > > def __unicode__(self):

Admin selectbox for ForeignKey

2007-12-14 Thread Nianbig
del ): title = models.CharField( maxlength=50,) region = models.ForeignKey( Category, null=True ) -- Thanks in advance. /Nianbig --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Prevent SQL-injection

2007-12-09 Thread Nianbig
Thanks for your reply. I´m building an advanced search/filter page and it got too messy doing it with the standard Django ORM... so I decided to go with my own SQL- string... Therefore I need a function that can make input strings SQL-safe.. /Nianbig On Dec 9, 1:39 am, Ned Batchelder <[EM

Re: Prevent SQL-injection

2007-12-08 Thread Nianbig
On Dec 9, 12:57 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Dec 8, 2007 5:58 PM, Nianbig <[EMAIL PROTECTED]> wrote: > > > > > > > On Dec 8, 11:54 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> > > wrote: > > > On Sat,

Re: Prevent SQL-injection

2007-12-08 Thread Nianbig
On Dec 8, 11:54 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sat, 2007-12-08 at 14:28 -0800, Nianbig wrote: > > I´m trying to use django.db.backend.quote_name function to prevent SQL- > > injection, as stated in the Django Book Security-chapter, > >http:/

Prevent SQL-injection

2007-12-08 Thread Nianbig
I´m trying to use django.db.backend.quote_name function to prevent SQL- injection, as stated in the Django Book Security-chapter, http://www.djangobook.com/en/beta/chapter20/. But I'm having difficulties in getting it working, "Could not import portal.objects.views.start. Error was: cannot

Django and memcached

2007-09-24 Thread Nianbig
576, in _val_to_store_info TypeError: Pickler() takes no keyword arguments I´m using django 0.96. Thanks in advance. /Nianbig --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post t