Access properties and functions in templates #279
Answered
by
silviogutierrez
themagiulio
asked this question in
Q&A
-
Is there a way to access properties and functions inside a template? Let's say I have the following model: class Group(models.Model):
...
members = models.ManyToManyField(User)
@property
def full_name(self):
return f"{self.name}#{self.identifier}" I would like to render in React the @template
class Group(NamedTuple):
name: Pick[Group, "full_name", "members.count"] |
Beta Was this translation helpful? Give feedback.
Answered by
silviogutierrez
Jun 27, 2023
Replies: 1 comment 5 replies
-
@themagiulio : there is! You can "Pick" anything marked as "property". It should Just Work™. |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
silviogutierrez
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@themagiulio : there is! You can "Pick" anything marked as "property". It should Just Work™.