Move FlagType into srht
This commit is contained in:
parent
d850243e1a
commit
0963b4a79f
|
@ -1,4 +1,3 @@
|
|||
from .flagtype import FlagType
|
||||
from .user import User
|
||||
from .ticketaccess import TicketAccess
|
||||
from .ticketstatus import TicketStatus, TicketResolution
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
import sqlalchemy.types as types
|
||||
|
||||
class FlagType(types.TypeDecorator):
|
||||
"""
|
||||
Encodes/decodes IntFlags on the fly
|
||||
"""
|
||||
|
||||
impl = types.Integer()
|
||||
|
||||
def __init__(self, enum):
|
||||
self.enum = enum
|
||||
|
||||
def process_bind_param(self, value, dialect):
|
||||
return int(value)
|
||||
|
||||
def process_result_value(self, value, dialect):
|
||||
return self.enum(value)
|
|
@ -1,6 +1,7 @@
|
|||
import sqlalchemy as sa
|
||||
from srht.database import Base
|
||||
from todosrht.types import FlagType, TicketAccess, TicketStatus, TicketResolution
|
||||
from srht.flagtype import FlagType
|
||||
from todosrht.types import TicketAccess, TicketStatus, TicketResolution
|
||||
|
||||
class Ticket(Base):
|
||||
__tablename__ = 'ticket'
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import sqlalchemy as sa
|
||||
from srht.database import Base
|
||||
from todosrht.types import FlagType, TicketAccess, TicketStatus, TicketResolution
|
||||
from srht.flagtype import FlagType
|
||||
from todosrht.types import TicketAccess, TicketStatus, TicketResolution
|
||||
|
||||
class TicketComment(Base):
|
||||
__tablename__ = 'ticket_comment'
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import sqlalchemy as sa
|
||||
import sqlalchemy_utils as sau
|
||||
from srht.database import Base
|
||||
from todosrht.types import FlagType
|
||||
from srht.types import FlagType
|
||||
from enum import Enum
|
||||
|
||||
class TicketSubscription(Base):
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import sqlalchemy as sa
|
||||
from srht.database import Base
|
||||
from todosrht.types import FlagType, TicketAccess, TicketStatus, TicketResolution
|
||||
from srht.flagtype import FlagType
|
||||
from todosrht.types import TicketAccess, TicketStatus, TicketResolution
|
||||
|
||||
class Tracker(Base):
|
||||
__tablename__ = 'tracker'
|
||||
|
|
Loading…
Reference in New Issue