Skip to content

Commit

Permalink
adding dataclass to record model (#33)
Browse files Browse the repository at this point in the history
Co-authored-by: Dan Sikes <[email protected]>
  • Loading branch information
dsikes and Dan Sikes authored Apr 9, 2023
1 parent 90bd223 commit c0afb20
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pocketbase/models/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

from pocketbase.models.utils.base_model import BaseModel
from pocketbase.utils import camel_to_snake
from dataclasses import dataclass, field


@dataclass
class Record(BaseModel):
collection_id: str
collection_name: str
expand: dict
collection_name: str = ""
expand: dict = field(default_factory=dict)

def load(self, data: dict) -> None:
super().load(data)
Expand Down

0 comments on commit c0afb20

Please sign in to comment.