vigiboard / vigiboard / model / vigilo_bdd / graph.py @ 57f7cb3f
History | View | Annotate | Download (1.16 KB)
1 |
# -*- coding: utf-8 -*-
|
---|---|
2 |
# vim:set expandtab tabstop=4 shiftwidth=4:
|
3 |
"""Modèle pour la table Graph"""
|
4 |
from __future__ import absolute_import |
5 |
|
6 |
from sqlalchemy.orm import mapper |
7 |
from sqlalchemy import Table, Column |
8 |
from sqlalchemy.types import String |
9 |
|
10 |
from ..vigilo_bdd_config import bdd_basename, metadata |
11 |
|
12 |
# Generation par SQLAutoCode
|
13 |
|
14 |
graph = Table(bdd_basename + 'graph',
|
15 |
metadata, |
16 |
Column(u'name',
|
17 |
String(length=100, convert_unicode=True, assert_unicode=None), |
18 |
primary_key=True, nullable=False), |
19 |
Column(u'template',
|
20 |
String(length=2500, convert_unicode=True, assert_unicode=None), |
21 |
primary_key=False, nullable=False), |
22 |
Column(u'vlabel',
|
23 |
String(length=2500, convert_unicode=True, assert_unicode=None), |
24 |
primary_key=False, nullable=False), |
25 |
mysql_engine='InnoDB',
|
26 |
mysql_charset='utf8'
|
27 |
) |
28 |
|
29 |
# Classe a mapper
|
30 |
|
31 |
class Graph(object): |
32 |
|
33 |
"""
|
34 |
Classe liée avec la table associée
|
35 |
"""
|
36 |
|
37 |
def __init__(self, name, template = '', vlabel = ''): |
38 |
self.name = name
|
39 |
self.template = template
|
40 |
self.vlabel = vlabel
|
41 |
|
42 |
mapper(Graph, graph) |