refactor(core): Relocate history model class

ref: #765 #759
This commit is contained in:
2025-05-17 04:24:11 +09:30
parent 17c7980e03
commit 262e883a26
5 changed files with 358 additions and 203 deletions

View File

@ -151,7 +151,13 @@ class ViewSet(ReadOnlyModelViewSet):
def get_serializer_class(self):
self.serializer_class = globals()[str( self.model._meta.verbose_name).replace(' ', '') + 'ViewSerializer']
model_name = str( self.model._meta.verbose_name).replace(' ', '')
if model_name == 'ModelHistory':
model_name = 'History'
self.serializer_class = globals()[model_name + 'ViewSerializer']
return self.serializer_class