Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

vigiboard / vigiboard / model / vigilo_bdd / graphgroups.py @ 57f7cb3f

History | View | Annotate | Download (943 Bytes)

1
# -*- coding: utf-8 -*-
2
# vim:set expandtab tabstop=4 shiftwidth=4:
3
"""Modèle pour la table GraphGroups"""
4
from __future__ import absolute_import
5

    
6
from sqlalchemy.orm import mapper
7
from sqlalchemy import Table, Column
8
from sqlalchemy.types import Integer, String
9

    
10
from ..vigilo_bdd_config import bdd_basename, metadata
11

    
12
# Generation par SQLAutoCode
13

    
14
graphgroups = Table(bdd_basename + 'graphgroups',
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'parent', Integer(), primary_key=False, nullable=True),
20
        mysql_engine='InnoDB',
21
        mysql_charset='utf8'
22
    )
23

    
24
# Classe a mapper
25

    
26
class GraphGroups(object):
27
    """
28
    Classe liée avec la table associée
29
    """
30
    
31
    def __init__(self, name, parent=None):
32
        self.name = name
33
        self.parent = parent
34

    
35
mapper(GraphGroups, graphgroups)