possible to keep elements' order while get_list(id__in=[...])?

2006-03-06 Thread EricHsu
hi all, giving a id list in which the elements' order is important, for example: category_id_list = [1, 4, 9, 6] is it possible to make sure that categorys.get_list(id__in=category_id_list) returns category object list in the same order as category_id_list? that is, make sure the returned list

[patch] dealing with unicode charaters (e.g. cjk characters) in tagging stuff

2006-02-23 Thread EricHsu
hello hugo, we're using your tagging code developing our site (in Chinese), while dealing with the tags containing Chinese characters, I found that these charaters were removed by the following line of code in the tagging.py: [code] tagslugs=dict([(slugify(latin1_to_ascii(el.strip())),

Re: Email injection ... What's wrong ?

2006-02-19 Thread EricHsu
I notice a problem with the django's header injection prevention code. It checks only if there's new line (\r or \n) in the header, I guess it should be improved, since when we want to send a utf-8 header, it reaches its limitation - from python's email package email.Header.Header.encode()

Re: Email injection ... What's wrong ?

2006-02-19 Thread EricHsu
Batiste wrote: > Hello, I have some spam incoming in my mailbox... The send_mail > function has to be protected ... What's wrong with my code ? > > def sendMail(request): > from django.core.mail import send_mail > if(request.POST.has_key('email')): > email = request.POST['email']

Re: how to search a specific model?

2006-01-07 Thread EricHsu
wOW! I get it done "by writing small wrappers around the generic view"! Thanks A LOT hugo! You've been a great help! I'm going to look into the pagination thing later ;)

Re: how to search a specific model?

2006-01-07 Thread EricHsu
btw, I tracked down to the stuff/search/views/generic.py, seem that the kwarg module_list hasn't been passed to the search() funtion from the utils.py, so I have to set the SEARCH_DEFINITION in the settings.py to get the searching work properly. It won't work if I set the search_info_dict like

Re: kinda really nOOb question: how to for loop an integer in template?

2006-01-04 Thread EricHsu
Guys, I created the range0 (0-index) and range1 (1-index filter $ svn diff defaultfilters.py Index: defaultfilters.py === --- defaultfilters.py (revision 1813) +++ defaultfilters.py (working copy) @@ -433,6 +433,14 @@ from

Re: kinda really nOOb question: how to for loop an integer in template?

2006-01-03 Thread EricHsu
Hi limodou, could you pls be more specific? Thanks!