-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Qute: shorter enum constant access #21854
Comments
/cc @mkouba |
I like the idea of
This already works with |
In general, |
Thanks! |
Description
At the moment we make enum values accessible in views using this declaration:
Which then exposes values such as
fr_epardaud_model_ContentStatus:NEW
which is handy in case of name conflict, but not so much if you don't have any conflict.The shorter behaviour can already be obtained with
@TemplateData(namespace = TemplateData.SIMPLENAME)
but I'd like to have another annotation that would be an alias for this. Perhaps@TemplateEnum
?This would be usable in the views as
ContentStatus:NEW
.Note that ATM I have a special case for accessing the
values()
enum static member:And I wonder if we should not automatically add it as for for all enums declared with
@TemplateData
and@TemplateEnum
? SoContentStatus:values
would call the.values()
static method. WDYT?Implementation ideas
No response
The text was updated successfully, but these errors were encountered: