Store the class metadata of fields in the class, to improve preformance
Cached data include, - lookup table between groups and fields of "oneof" fields - default value creator of each field - type hint of each field
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# sources: {{ ', '.join(description.files) }}
|
||||
# plugin: python-betterproto
|
||||
from dataclasses import dataclass
|
||||
{% if description.datetime_imports %}
|
||||
from datetime import {% for i in description.datetime_imports %}{{ i }}{% if not loop.last %}, {% endif %}{% endfor %}
|
||||
|
||||
@@ -38,7 +37,7 @@ class {{ enum.py_name }}(betterproto.Enum):
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% for message in description.messages %}
|
||||
@dataclass
|
||||
@betterproto.protoclass
|
||||
class {{ message.py_name }}(betterproto.Message):
|
||||
{% if message.comment %}
|
||||
{{ message.comment }}
|
||||
|
||||
Reference in New Issue
Block a user