hi all,
Here is a nOOb question:
I'm using the paginate function, I got the total pages, I would like to
loop and generate each page number, how can I do that?
{% if is_paginated %}
{% for page_number in pages %}
{{ page_number }}
{% endfor %}
{% endif %}
doesn't se
the python way
{% for page_number in range(pages) %}
doesn't work either... :'(
Hi limodou, could you pls be more specific? Thanks!
guys, I did it by hacking into django's list_detail.py
just add a simply line here:
$ svn diff list_detail.py
Index: list_detail.py
===
--- list_detail.py (revision 1813)
+++ list_detail.py (working copy)
@@ -58,6 +58,7 @@
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 p
hi all, I've submitted it as a ticket :)
http://code.djangoproject.com/ticket/1162
guys,
by reading simon's AbstractSearching:
https://simon.bofh.ms/cgi-bin/trac-django-projects.cgi/wiki/AbstractSearching
I got my searching for stories work by:
1. settings.py - add:
SEARCH_DEFINITIONS = {
"foo.apps.bar.search",
}
INSTALL_APPS = {
[snip]
'stuff.search'
}
2. url
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 th
BiG Thanks to hugo!
"To have a unified search" - that make things clear now :)
I got my site's searching against a single model work with writing
lookup_kind function like yours! Now I can search for stories with
query_string = 'kind:storys foo bar' and search for users with
query_string = 'kind
Yet another problem :)
Could I paginate the search result?
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 ;)
hi Aggelos,
if you pass a tuple to your custom filter, then the arg should become
the tuple you could access. I tried something like this (for testing
purpose :):
{{ story.summary|myfilter:story }}
then inside the myfilter, I can:
def myfilter(value, arg):
story = arg
title = story.title
hey guys,
when I tried to save an "https://..."; url into the db, the django's
manipulator kept complaining that it was invalid. It is because the
django/core/validators.py's url_re is a little bit too simple, the
url_re pattern accepts only url begins with "http://";.
I've read the RFC3986 whic
Adrian Holovaty wrote:
> Hey Eric,
>
> Thanks for the pointer on this. I've updated the code in trunk to
> accept "https".
>
> Adrian
>
My pleasure! I've updated my django source to the latest trunk :)
- Eric
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']
>
BTW, you may want to try to use pycaptcha
(http://sourceforge.net/projects/pycaptcha/) to prevent automated
spamming by using your mail form.
- Eric
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" gr
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() method
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())), el.strip(
with this change, ascii characters in the slug field remain as what
they are:
"Hello World 你好"
becomes:
hello-world-xe4xbdxa0xe5xa5xbd
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post
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 l
20 matches
Mail list logo