On Sat, 2008-11-15 at 12:16 -0800, [EMAIL PROTECTED] wrote: > Hi, > > From the django documentation, it looks like it is not possible to > pass arguments to methods from the template HTML code. > > For example: > > class MyModel(Model): > def foo(self): > return 'This works' > > can be accessed by: {{ mymodel.foo }} in an HTML template. > > What I am trying to do, however, is to access data based on arguments > for this method. This is my example scenario: I have several high > resolution photographs, and I want to be able to write some code that > displays thumbnails:
[...] > Is there a cleaner or better way to do this? A template tag. Template tags are the way to do any complex processing. Filters just access existing data very simply and return them. The latter intentionally don't take arguments; that isn't an oversight. The syntax difference is a partial clue to the template writer that there's something more complex going on in the background. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---