small rename
This commit is contained in:
parent
1334da35bb
commit
30f74f6051
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user