-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c481d30
commit 0d7ee64
Showing
4 changed files
with
28 additions
and
47 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,9 @@ | ||
import enum | ||
|
||
from dipdup import fields | ||
from dipdup.models import Model | ||
|
||
|
||
class ExampleModel(Model): | ||
class Deposit(Model): | ||
id = fields.IntField(primary_key=True) | ||
array = fields.ArrayField() | ||
big_int = fields.BigIntField() | ||
binary = fields.BinaryField() | ||
boolean = fields.BooleanField() | ||
decimal = fields.DecimalField(10, 2) | ||
date = fields.DateField() | ||
datetime = fields.DatetimeField() | ||
enum_ = fields.EnumField(enum.Enum) | ||
float = fields.FloatField() | ||
int_enum = fields.IntEnumField(enum.IntEnum) | ||
int_ = fields.IntField() | ||
json = fields.JSONField() | ||
small_int = fields.SmallIntField() | ||
text = fields.TextField() | ||
time_delta = fields.TimeDeltaField() | ||
time = fields.TimeField() | ||
uuid = fields.UUIDField() | ||
|
||
relation: fields.ForeignKeyField['ExampleModel'] = fields.ForeignKeyField( | ||
'models.ExampleModel', related_name='reverse_relation' | ||
) | ||
m2m_relation: fields.ManyToManyField['ExampleModel'] = fields.ManyToManyField( | ||
'models.ExampleModel', related_name='reverse_m2m_relation' | ||
) | ||
|
||
created_at = fields.DatetimeField(auto_now_add=True) | ||
updated_at = fields.DatetimeField(auto_now=True) | ||
|
||
relation_id: int | ||
m2m_relation_ids: list[int] | ||
|
||
class Meta: | ||
abstract = True | ||
level = fields.IntField() | ||
token = fields.CharField(max_length=36) | ||
amount = fields.IntField() |
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
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