#18112: contrib.syndication.views: Add hook for getting extra context in feed templates -------------------------------------+------------------------------------ Reporter: slinkp | Owner: nobody Type: New feature | Status: new Component: contrib.syndication | Version: master Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 1 | Needs documentation: 1 Needs tests: 1 | Patch needs improvement: 0 Easy pickings: 1 | UI/UX: 0 -------------------------------------+------------------------------------
Comment (by slinkp): I can see how this is confusing. Those names were not chosen by me, they are in the current implementation, as the old part of the diff shows. If you look in the local scope of where I'm invoking this method, the old implementation has these : `obj` - the object returned by get_object(). This was not being made available to the templates; I added it as the 'obj' kwarg to get_context_data(), which by default ignores it; but I'm passing it so at least it's possible to use it in your subclass if you want. `item` - the current feed item from this iteration of obj.items(). This was already being made available to the template context as, very unfortunately, 'obj'. That kind of sucks, as it's easy to confuse with the one returned by get_object(). But it *has* to be named 'obj' in the template context or we'll break existing templates. Any thoughts on how to make this less confusing without breaking backward compatibility? -- Ticket URL: <https://code.djangoproject.com/ticket/18112#comment:3> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.