vigiboard / dashboard / model / bdd_dashboard / servicegroups.py @ 70c5f034
History | View | Annotate | Download (967 Bytes)
1 | 805cc54a | Thomas ANDREJAK | # -*- coding: utf-8 -*-
|
---|---|---|---|
2 | """Model For ServiceGroups Table"""
|
||
3 | |||
4 | from sqlalchemy.orm import mapper, relation |
||
5 | from sqlalchemy import Table, ForeignKeyConstraint, Column, Index |
||
6 | from sqlalchemy.types import Integer, String, Text, DateTime |
||
7 | |||
8 | from dashboard.model import metadata |
||
9 | |||
10 | |||
11 | # Generation par SQLAutoCode
|
||
12 | |||
13 | servicegroups = Table('servicegroups', metadata,
|
||
14 | Column(u'servicename', String(length=100, convert_unicode=False, assert_unicode=None), primary_key=True, nullable=False), |
||
15 | Column(u'groupname', String(length=100, convert_unicode=False, assert_unicode=None), primary_key=True, nullable=False), |
||
16 | ForeignKeyConstraint([u'servicename'], [u'service.name'], name=u'servicegroups_ibfk_1'), |
||
17 | ForeignKeyConstraint([u'groupname'], [u'groups.name'], name=u'servicegroups_ibfk_2'), |
||
18 | ) |
||
19 | Index(u'groupname', servicegroups.c.groupname, unique=False |
||
20 | ) |
||
21 | # Classe a mapper
|
||
22 | |||
23 | class ServiceGroups(object): |
||
24 | pass
|
||
25 | mapper(ServiceGroups,servicegroups) |
||
26 |