<commit_before># -*- coding: utf-8 -*-

"""
byceps.blueprints.seating.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2014 <NAME>
"""

from collections import namedtuple

from flask import g
from sqlalchemy.ext.hybrid import hybrid_property

from ...database import BaseQuery, db, generate_uuid
from ...util.instances import ReprBuilder

from ..party.models import Party


Point = namedtuple('Point', ['x', 'y'])


class AreaQuery(BaseQuery):

    def for_current_party(self):
        return self.filter_by(party_id=g.party.id)


class Area(db.Model):
    """A spatial representation of seats in one part of the party
    location.

    Seats can belong to different categories.
    """
    __tablename__ = 'seating_areas'
    __table_args__ = (
        db.UniqueConstraint('party_id', 'slug'),
        db.UniqueConstraint('party_id', 'title'),
    )
    query_class = AreaQuery

    id = db.Column(db.Uuid, default=generate_uuid, primary_key=True)
    party_id = db.Column(db.Unicode(20), db.ForeignKey('parties.id'))
    party = db.relationship(Party, backref='seating_areas')
    slug = db.Column(db.Unicode(40))
    title = db.Column(db.Unicode(40))

    def __repr__(self):
        return ReprBuilder(self) \
            .add_with_lookup('id') \
            .add_with_lookup('party') \
            .add_with_lookup('slug') \
            .add_with_lookup('title') \
            .build()


class Category(db.Model):
    """A seat's category which may (indirectly) indicate its price and
    features.
    """
    __tablename__ = 'seat_categories'
    __table_args__ = (
        db.UniqueConstraint('party_id', 'title'),
    )

    id = db.Column(db.Uuid, default=generate_uuid, primary_key=True)
    party_id = db.Column(db.Unicode(20), db.ForeignKey('parties.id'))
    party = db.relationship(Party, backref='seat_categories')
    title = db.Column(db.Unicode(40))<commit_msg>Added fields to seating area model.<commit_after># -*- coding: utf-8 -*-

"""
byceps.blueprints.seating.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2014 <NAME>
"""

from collections import namedtuple

from flask import g
from sqlalchemy.ext.hybrid import hybrid_property

from ...database import BaseQuery, db, generate_uuid
from ...util.instances import ReprBuilder

from ..party.models import Party


Point = namedtuple('Point', ['x', 'y'])


class AreaQuery(BaseQuery):

    def for_current_party(self):
        return self.filter_by(party_id=g.party.id)


class Area(db.Model):
    """A spatial representation of seats in one part of the party
    location.

    Seats can belong to different categories.
    """
    __tablename__ = 'seating_areas'
    __table_args__ = (
        db.UniqueConstraint('party_id', 'slug'),
        db.UniqueConstraint('party_id', 'title'),
    )
    query_class = AreaQuery

    id = db.Column(db.Uuid, default=generate_uuid, primary_key=True)
    party_id = db.Column(db.Unicode(20), db.ForeignKey('parties.id'))
    party = db.relationship(Party, backref='seating_areas')
    slug = db.Column(db.Unicode(40))
    title = db.Column(db.Unicode(40))
    details = db.Column(db.Unicode(40))
    image_filename = db.Column(db.Unicode(40))
    image_width = db.Column(db.Integer)
    image_height = db.Column(db.Integer)
    seat_quantity = db.Column(db.Integer)

    def __repr__(self):
        return ReprBuilder(self) \
            .add_with_lookup('id') \
            .add_with_lookup('party') \
            .add_with_lookup('slug') \
            .add_with_lookup('title') \
            .build()


class Category(db.Model):
    """A seat's category which may (indirectly) indicate its price and
    features.
    """
    __tablename__ = 'seat_categories'
    __table_args__ = (
        db.UniqueConstraint('party_id', 'title'),
    )

    id = db.Column(db.Uuid, default=generate_uuid, primary_key=True)
    party_id = db.Column(db.Unicode(20), db.ForeignKey('parties.id'))
    party = db.relationship(Party, backref='seat_categories')
    title = db.Column(db.Unicode(40))
{'fraction_non_alphanumeric': 0.1465603190428714, 'fraction_numerical': 0.010468594217347957, 'mean_word_length': 3.343073593073593, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4643236', 'n_tokens_mistral': 1328, 'n_tokens_neox': 1273, 'n_words': 264}