This is not 100% related to the ticket, but something to think about.
In ReactJS, there a concept called propTypes, which will check all props
(they are similar to context in concept I think) listed with types in UI
component.
So maybe we can have something similar in django template system that a
template can have an attribute called contextTypes and it can be a dict of
context the template may have. It doesn't need to have all possible context
values, only include those you want to make sure the context are passed and
value types are correct.
A simple example can be
contextTypes = {
"name": contextTypes.string.isRequired,
}
On Thursday, September 21, 2017 at 7:05:28 AM UTC-4, Shreyas Pandya wrote:
>
> Hi All,
>
> What is your opinion on having an option to raise an error in template if
> variable is not found in context. This may be useful for automated tests
> as discussed in ticket.
>
> reference ticket #28618 <https://code.djangoproject.com/ticket/28618> ;
>
> Thanks
>
> regards
> Shreyas
>
--
You received this message because you are subscribed to the Google Groups
"Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/46bb3674-3eeb-4b8c-8599-7950036e92f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.