コード例 #1
0
class User(elixir.Entity):
    """ 
        The User model. Contains all information about a user
        and allows querying. One user can have many games
    """

    name = elixir.Field(elixir.String(40), unique=True)
    password = elixir.Field(elixir.String(512))
    email = elixir.Field(elixir.String(50))

    participated = elixir.ManyToMany("Event")
    games = elixir.OneToMany("Game")
    ratings = elixir.OneToMany("Rating")

    def __repr__(self):
        return "<User '%s' (%s)>" % (self.name, self.email)
コード例 #2
0
class Order(el.Entity):
    name = el.Field(el.String(100))
    status = el.ManyToOne(Status)
    customer = el.ManyToOne(People)
    assignee = el.ManyToOne(People)
    delivery = el.Field(el.Boolean)
    address = el.Field(el.String(200))
    items = el.OneToMany('Item')
コード例 #3
0
ファイル: network.py プロジェクト: smart-fm/simmobility-prod
class Link(elixir.Entity):
    elixir.using_options(tablename="links")
    intersections = elixir.ManyToMany("Intersection")
    road_segments = elixir.OneToMany("Road_segment")
    road = elixir.ManyToOne("Road")

    def forward_road_segments(self):
        return [
            road_segment for road_segment in self.road_segment
            if road_segment.is_forward
        ]

    def reverse_road_segments(self):
        return [
            road_segment for road_segment in self.road_segment
            if not road_segment.is_forward
        ]
コード例 #4
0
class Event(elixir.Entity):
    """
        The Event model. Contains all information regarding an event.
        This includes from when to when it's happening, the submitted games,
        and which users participated. Includes the theme.

        Many events can have many users and many games.
    """

    start = elixir.Field(elixir.DateTime(512))
    end = elixir.Field(elixir.DateTime(512))

    name = elixir.Field(elixir.String(512))
    theme = elixir.Field(elixir.String(256))
    voting = elixir.Field(elixir.Boolean())

    games = elixir.OneToMany("Game")
    participants = elixir.ManyToMany("User")

    def __repr__(self):
        return "<Event '%s' (%s - %s)>" % (self.name, self.start, self.end)
コード例 #5
0
ファイル: model.py プロジェクト: mitin123/tw2.core
class Movie(elixir.Entity):
    title = elixir.Field(elixir.String)
    director = elixir.Field(elixir.String)
    genre = elixir.ManyToMany('Genre')
    cast = elixir.OneToMany('Cast')
コード例 #6
0
ファイル: network.py プロジェクト: smart-fm/simmobility-prod
class Road(elixir.Entity):
    elixir.using_options(tablename="roads")
    links = elixir.OneToMany("Link")
    name = elixir.Field(elixir.Text)
コード例 #7
0
ファイル: network.py プロジェクト: smart-fm/simmobility-prod
class Road_segment(elixir.Entity):
    elixir.using_options(tablename="road_segments")
    lanes = elixir.OneToMany("Lane")
    link = elixir.ManyToOne("Link")
    segment_index = elixir.Field(elixir.SmallInteger)
    is_forward = elixir.Field(elixir.Boolean)
コード例 #8
0
 class Director(Person):
     movies = e.OneToMany('Movie')
     e.using_options(inheritance='multi')
コード例 #9
0
class Sha256(elixir.Entity):
    sha256 = elixir.Field(elixir.Unicode(64), index=True)
    files = elixir.OneToMany('File')
コード例 #10
0
class Sha1(elixir.Entity):
    sha1 = elixir.Field(elixir.Unicode(40), index=True)
    files = elixir.OneToMany('File')
コード例 #11
0
class Md5(elixir.Entity):
    md5 = elixir.Field(elixir.Unicode(32), index=True)
    files = elixir.OneToMany('File')
コード例 #12
0
class MimeType(elixir.Entity):
    mimetype = elixir.Field(elixir.Unicode(150))
    files = elixir.OneToMany('File')
コード例 #13
0
class FullPath(elixir.Entity):
    fullpath = elixir.Field(elixir.Unicode(900), index=True)
    files = elixir.OneToMany('File')
コード例 #14
0
class Extension(elixir.Entity):
    extension = elixir.Field(elixir.Unicode(50), index=True)
    files = elixir.OneToMany('File')
コード例 #15
0
class Ssdeep(elixir.Entity):
    ssdeep = elixir.Field(elixir.Unicode(150), index=True)
    files = elixir.OneToMany('File')