vigiboard / dashboard / model / bdd_dashboard / service.py @ 805cc54a
History | View | Annotate | Download (840 Bytes)
1 |
# -*- coding: utf-8 -*-
|
---|---|
2 |
"""Model For Service 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 |
service = Table('service', metadata,
|
13 |
Column(u'name', String(length=255, convert_unicode=False, assert_unicode=None), primary_key=True, nullable=False), |
14 |
Column(u'type', String(length=255, convert_unicode=False, assert_unicode=None), primary_key=False, nullable=False), |
15 |
Column(u'command', String(length=255, convert_unicode=False, assert_unicode=None), primary_key=False, nullable=False), |
16 |
) |
17 |
Index(u'name', service.c.name, unique=False) |
18 |
|
19 |
# Classe a mapper
|
20 |
|
21 |
class Service(object): |
22 |
pass
|
23 |
mapper(Service,service) |
24 |
|
25 |
|