> > > >If you need to push back a value in a variable call related_entries, then >> you will want to set a value in the context dictionary: > > > > > >context[related_entries] = <some value here> > > Correction on earlier mail when trying some other things. I do this in the def render. This looks like:
class RelatedEntryNode(template.Node): def __init__(self, model, number, categories, varname): self.model = model self.number = int(number) self.categories = template.Variable(categories) self.varname = varname def render(self, context): related = self.categories.resolve(context) context[self.varname] = related return '' > > > >You won't be able to resolve it as a Variable, because it (presumably) >> doesn't even exist >before you call your custom tag, but once you set it on >> the context object, it will be >available to the rest of the template. > > >> This I don't understand. As I understand Django (but correct me if I'm >> wrong) the related_entries should be a dictionary or list of >> Entry-instances. > > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/6pzLSUYiFpIJ. 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.