Re: How to format string on I18n

2012-01-04 Thread Krator Ado
msgid u"邀請已送到%(email)s"
and add "# coding=utf-8" at the first line of your .py file.

2012/1/4 李 强 

> Lack of a full stop,maybe.
>
> 在 2011-12-5,下午2:07, Tsung-Hsien 写道:
>
> > Hello
> >I get the wrong message when type a string which needed to format
> > such as
> >
> > msgid "An inviatation was sent to %(email)s."
> > msgstr "邀請已送到%(email)s"
> >
> >
> --
> > Incorrect string value: '\xE9\x82\x80\xE8\xAB\x8B...' for column
> > 'message' at row 1
> >
> --
> > How to fix it?
> > Thanks!!
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
物竞天择,适者生存。

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: /?next= not redirect user

2012-01-27 Thread Krator Ado
you can do this by doing:
If a page requires logined, like a uri "/blog/create/" which is routed to a
function "create_blog()" , you can redirect this to login page followed by
the url
for example:

# /your-project/blogs/views.py
# suppose your User has a method named is_logined() to judge if the user
has logined
def create_blog(request):
if not user.is_logined():
return HttpResponseRedirect('/login/?url=' +
request.build_absolute_uri())
else:
#do your work

# /your-project/users/views.py
def login(request):
#do your login work
return HttpResponseRedirect(request.GET.get('url'))

2012/1/11 Guddu 

> The way i did it was to have the following in my login template
> (inside the login )
>
> 
>
> Replace /SiteRoot/url with whatever you would like the user to be
> redirected to after a successful login.
>
> Regards,
> Guddu
>
> On Jan 11, 7:39 am, Weldan  wrote:
> > hi. can anyone show me how to do this . after successfully login user not
> > redirected to request.path. thanks for advance
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
物竞天择,适者生存。

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.