Skip to content

No way to specify objects that have attributes and support iteration #10

Closed
@thibaudcolas

Description

@thibaudcolas

In GitLab by @bcdickinson on Dec 19, 2017, 22:15

Motivating example from: search results. search_results value is both iterated and accessed with dot notation:

{% for result in search_results %}
{% if search_results.paginator.count %}

The YAML format doesn't support specifying values that behave this way. A possible suggestion would be to allow numeric keys in the YAML e.g.

search_results:
  paginator:
    count: 42
  0: ... # result 1
  1: ... # result 2
  ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    decision neededThis requires a decisiondjangoRelated to Django templates capabilitiesenhancementNew feature or request

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions