If this doesn't help, it's probably a bug in Django 0.96 templates. Try switching to 1.0, it has a lot of Unicode-related fixes: http://docs.djangoproject.com/en/dev/ref/unicode/
On Oct 8, 10:06 am, Alexander Kojevnikov <[EMAIL PROTECTED]> wrote: > Try prefixing your string with 'u' in PostA.render(): > > return u"<li><a id='%s' href='/post/%s.html'>%s</a></li>" % > (p.id,p.id,p.title) > > On Oct 8, 1:18 am, Gmail <[EMAIL PROTECTED]> wrote: > > > Current I Try to Use django's Custom Tags, > > It is usful,I like it. > > > but when i try to render something Unicode , > > I got UnicodeDecodeError. > > > This is my Tag: > > class PostA(template.Node): > > def render(self, context): > > p=context['p'] > > return "<li><a id='%s' href='/post/%s.html'>%s</a></li>" % > > (p.id,p.id,p.title) > > def posta(parser, token): > > return PostA() > > > in the template: > > {%for p in paths%} > > <li>{%posta p.id p.title%}</li> > > {% endfor %} > > > paths is a list of Post > > Post is my model: > > class Post(db.Model): > > id=db.StringProperty(required=True) > > title = db.StringProperty(required=True) > > path = db.StringProperty() > > > in the Handler: > > template_values={ > > 'title':p.title, > > 'paths':paths, > > 'content':p.content, > > 'relates':relates > > } > > return shortcuts.render_to_response("post.html",template_values) > > So What your Idea? > > > I think there are something wrong in the shortcuts module when it is > > dealing whit unicode, > > but i can not find it. > > Any reply will be appreciated! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---