What is a lot of fucking work!
This commit is contained in:
parent
85c07ed4f3
commit
3414b5c334
8 changed files with 586 additions and 216 deletions
26
db_addendum.py
Normal file
26
db_addendum.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
from psycopg.sql import SQL, Identifier, Literal, Composed
|
||||
from based.columns import (
|
||||
IntegerColumnDefinition,
|
||||
)
|
||||
|
||||
|
||||
class UserRefColumnDefinition(IntegerColumnDefinition):
|
||||
def __init__(self, name: str):
|
||||
super().__init__(name)
|
||||
|
||||
def sql(self):
|
||||
return SQL("{} INTEGER NOT NULL").format(Identifier(self.name))
|
||||
|
||||
def serialize(self):
|
||||
return f"{self.name}:asset"
|
||||
|
||||
|
||||
class AssetRefColumnDefinition(IntegerColumnDefinition):
|
||||
def __init__(self, name: str):
|
||||
super().__init__(name)
|
||||
|
||||
def sql(self):
|
||||
return SQL("{} INTEGER NOT NULL").format(Identifier(self.name))
|
||||
|
||||
def serialize(self):
|
||||
return f"{self.name}:asset"
|
||||
Loading…
Add table
Add a link
Reference in a new issue