Sigh, seems not better way, sometimes it's ugly also to put them on the views.py - A/B/C could be the attribute of an element among a list of elements. Say, A is x.A, B is y.B, C is z.C, then you need to create a tuple for them on views side, and thus make a coupling for the order in the tuple.
Make everything into the views doesn't always work - at least doesn't always work gracefully. On Sat, Aug 15, 2009 at 12:24 AM, Javier Guerra <jav...@guerrag.com> wrote: > > On Fri, Aug 14, 2009 at 11:18 AM, realfun<real...@gmail.com> wrote: > > Hi, > > I have met the situation like "if A==B or A==C: doSomething...", or, "if > > A==B or C: doSomething..." > > I found it's hard to express in Django template, and small though, so no > > meaning to write it as a filter. > > put the logic in the view function (or maybe in the model!) and hand a > simple boolean to the template > > > -- > Javier > > > > -- 代码发芽网: http://fayaa.com/code/ (无需插件支持blog代码高亮,100+种语言,30+种高亮主题) 游戏发芽网: http://fayaa.com/youxi/ (华容道、数独等在线游戏及求解、图解) 我的Blog: 半瓶墨水(http://www.2maomao.com/blog) Follow me @ http://twitter.com/realfun --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---