small rename
This commit is contained in:
@@ -48,11 +48,11 @@ class BaseModel( models.Model ):
|
||||
await sync_to_async(lambda: [ getattr(self, f) for f in fields ])()
|
||||
|
||||
|
||||
_model_dict_presentations = {}
|
||||
_model_presentations = {}
|
||||
@classmethod
|
||||
def dict_presentation( cls, name ):
|
||||
def presentation( cls, name ):
|
||||
def attacher_decorator( f ):
|
||||
cls._model_dict_presentations[name] = f
|
||||
cls._model_presentations[name] = f
|
||||
return f
|
||||
return attacher_decorator
|
||||
|
||||
@@ -62,8 +62,8 @@ class BaseModel( models.Model ):
|
||||
"""
|
||||
|
||||
if presentation_name:
|
||||
assert presentation in self._model_dict_presentations, f"This model '{self.__class__}' does not have a '{presentation_name}' presentation!"
|
||||
fields.extend( self._model_dict_presentations[presentation_name].fields )
|
||||
assert presentation in self._model_presentations, f"This model '{self.__class__}' does not have a '{presentation_name}' presentation!"
|
||||
fields.extend( self._model_presentations[presentation_name].fields )
|
||||
|
||||
results = {}
|
||||
for f in fields:
|
||||
|
||||
Reference in New Issue
Block a user