forked from CapivaraProjects/database
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathType.py
More file actions
25 lines (21 loc) · 680 Bytes
/
Type.py
File metadata and controls
25 lines (21 loc) · 680 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from sqlalchemy import Column, String, Integer
import models.Type
from repository.base import Base
class Type(Base.Base):
__tablename__ = 'types'
id = Column(Integer, primary_key=True)
value = Column(String(2000))
description = Column(String(2000))
def __init__(self,
id=0,
value="",
description="",
type=models.Type.Type()):
if(type.value or type.id):
self.id = type.id
self.value = type.value
self.description = type.description
else:
self.id = id
self.value = value
self.description = description