forked from FerreroJeremy/ln2sql
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathColumn.py
executable file
·48 lines (35 loc) · 885 Bytes
/
Column.py
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# -*- coding: utf-8 -*
import sys
import unicodedata
reload(sys)
sys.setdefaultencoding("utf-8")
class Column:
name = ''
type = ''
primary = False
foreign = False
def __init__(self, name=None, type=None):
if name is None:
self.name = ''
else:
self.name = name
if type is None:
self.type = ''
else:
self.type = type
def get_name(self):
return self.name
def set_name(self, name):
self.name = name
def get_type(self):
return self.type
def set_type(self, type):
self.type = type
def is_primary(self):
return self.primary
def set_as_primary(self):
self.primary = True
def is_foreign(self):
return self.foreign
def set_as_foreign(self, references):
self.foreign = references