Skip to content

Commit

Permalink
_field_defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
Teagan42 authored Sep 8, 2024
1 parent 2f72306 commit 1de7321
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions varken/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@

class BaseModel:
"""Base class to handle dynamic fields from APIs."""
_field_defaults = {}

def __init__(self, **kwargs):
if len(self._field_defaults.keys()) == 0:
for key, value in self.__dict__.items():
self._field_defaults[key] = value

for key, value in kwargs.items():
setattr(self, key, value)

Expand Down

0 comments on commit 1de7321

Please sign in to comment.