This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from base import BaseImmutable | |
class ImmutableModel(BaseImmutable): | |
def __init__(self, django_model): | |
temp_dict = {} | |
for field in django_model._meta.fields: | |
temp_dict[field.name] = getattr(django_model,field.name) | |
self.__dict__ = temp_dict |