vigiboard / dashboard / model / bdd_dashboard / hostgroups.py @ 70c5f034
History | View | Annotate | Download (929 Bytes)
1 | 805cc54a | Thomas ANDREJAK | # -*- coding: utf-8 -*-
|
---|---|---|---|
2 | """Model For HostGroups 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 | hostgroups = Table('hostgroups', metadata,
|
||
14 | Column(u'hostname', 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'hostname'], [u'host.name'], name=u'hostgroups_ibfk_1'), |
||
17 | ForeignKeyConstraint([u'groupname'], [u'groups.name'], name=u'hostgroups_ibfk_2'), |
||
18 | ) |
||
19 | Index(u'groupname', hostgroups.c.groupname, unique=False) |
||
20 | |||
21 | # Classe a mapper
|
||
22 | |||
23 | class HostGroups(object): |
||
24 | pass
|
||
25 | mapper(HostGroups,hostgroups) |
||
26 |