-#!/usr/bin/python2.6
-# -*- coding: iso-8859-15 -*-
-# $Id$
-# $HeadURL$
-"""This module contains code to make tha access of winterrodeln
-tables in MediaWiki easy. The module uses sqlalchemy to access the database.
-"""
-from sqlalchemy import Table, Column, types, schema
-
-
-def wrreport_table(metadata):
- """Returns the sqlalchemy Table representing the "wrreport" Winterrodeln table in MediaWiki.
- Current table definition.
- * version 1.2
- * version 1.3 (no changes)
- * version 1.4 (no changes)
- :param metadata: metadata = sqlalchemy.MetaData()
- """
- return Table("wrreport", metadata,
- Column("id", types.Integer, primary_key=True),
- Column("page_id", types.Integer, schema.ForeignKey('wrsleddingcache.page_id')),
- Column("page_title", types.Unicode(255), nullable=False),
- Column("date_report", types.Date),
- Column("date_entry", types.DateTime, nullable=False),
- Column("date_invalid", types.DateTime),
- Column("condition", types.Integer),
- Column("description", types.Unicode),
- Column("author_name", types.Unicode(30)),
- Column("author_ip", types.Unicode(15)),
- Column("author_userid", types.Integer),
- Column("author_username", types.Unicode(30)),
- Column("delete_date", types.DateTime),
- Column("delete_person_name", types.Unicode(30)),
- Column("delete_person_ip", types.Unicode(15)),
- Column("delete_person_userid", types.Integer),
- Column("delete_person_username", types.Unicode(30)),
- Column("delete_reason_public", types.Unicode),
- )
-
-
-def wrsledruncache_table(metadata):
- """Returns the sqlalchemy Table representing the "wrsledruncache" Winterrodeln table in MediaWiki.
- Current table definition
- * version 1.4 (renamed table and added column walkup_possible)
- :param metadata: metadata = sqlalchemy.MetaData()
- """
- return Table("wrsledruncache", metadata,
- Column("page_id", types.Integer, primary_key=True),
- Column("page_title", types.Unicode(255)),
- Column("position_latitude", types.Float),
- Column("position_longitude", types.Float),
- Column("top_latitude", types.Float),
- Column("top_longitude", types.Float),
- Column("top_elevation", types.Integer),
- Column("bottom_latitude", types.Float),
- Column("bottom_longitude", types.Float),
- Column("bottom_elevation", types.Integer),
- Column("length", types.Integer),
- Column("difficulty", types.Integer),
- Column("avalanches", types.Integer),
- Column("operator", types.Unicode(255)),
- Column("public_transport", types.Integer),
- Column("walkup_possible", types.Boolean),
- Column("walkup_time", types.Integer),
- Column("walkup_separate", types.Float),
- Column("walkup_separate_comment", types.Unicode(255)),
- Column("lift", types.Boolean),
- Column("lift_details", types.Unicode(255)),
- Column("night_light", types.Float),
- Column("night_light_comment", types.Unicode(255)),
- Column("night_light_days", types.Integer),
- Column("night_light_days_comment", types.Unicode(255)),
- Column("sled_rental", types.Boolean),
- Column("sled_rental_comment", types.Unicode(255)),
- Column("cachet", types.Unicode(255)),
- Column("information_web", types.Unicode(255)),
- Column("information_phone", types.Unicode(255)),
- Column("image", types.Unicode(255)),
- Column("show_in_overview", types.Boolean),
- Column("forum_id", types.Integer),
- Column("under_construction", types.Boolean),
- )
-
-
-def wrinncache_table(metadata):
- """Returns the sqlalchemy Table representing the "wrinncache" Winterrodeln table in MediaWiki.
- Current table definition
- * version 1.3 (changes made from version 1.2)
- * version 1.4 (no changes)
- :param metadata: metadata = sqlalchemy.MetaData()
- """
- return Table("wrinncache", metadata,
- Column("page_id", types.Integer, primary_key=True),
- Column("page_title", types.Unicode(255)),
- Column("position_latitude", types.Float),
- Column("position_longitude", types.Float),
- Column("position_elevation", types.Integer),
- Column("seats", types.Integer),
- Column("overnight", types.Boolean),
- Column("overnight_comment", types.Unicode(255)),
- Column("smoker_area", types.Boolean),
- Column("nonsmoker_area", types.Boolean),
- Column("sled_rental", types.Boolean),
- Column("sled_rental_comment", types.Unicode(255)),
- Column("mobile_provider", types.Unicode),
- Column("homepage", types.Unicode(255)),
- Column("email_list", types.Unicode),
- Column("phone_list", types.Unicode),
- Column("image", types.Unicode(255)),
- Column("sledding_list", types.Unicode),
- Column("under_construction", types.Boolean),
- )
-
-