Ejemplo n.º 1
0
class City(db.Model):
    __tablename__ = 'Cities'

    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(120))
    state = db.Column(db.String(2))
    artists = db.relationship('Artist', back_populates='city', lazy='joined')
    venues = db.relationship('Venue', back_populates='city', lazy='joined')
Ejemplo n.º 2
0
Archivo: Show.py Proyecto: vgotra/FSND
class Show(db.Model):
    __tablename__ = 'Shows'

    id = db.Column(db.Integer, primary_key=True)
    start_time = db.Column(db.DateTime)
    venue_id = db.Column(db.Integer, db.ForeignKey('Venues.id'), nullable=False)
    venue = db.relationship('Venue', back_populates='shows', lazy='joined')
    artist_id = db.Column(db.Integer, db.ForeignKey('Artists.id'), nullable=False)
    artist = db.relationship('Artist', back_populates='shows', lazy='joined')
Ejemplo n.º 3
0
class Genre(db.Model):
    __tablename__ = 'Genres'

    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(50))
    venues = db.relationship("Venue",
                             secondary=venuegenre_table,
                             back_populates="genres")
    artists = db.relationship("Artist",
                              secondary=artistgenre_table,
                              back_populates="genres")
Ejemplo n.º 4
0
Archivo: Movie.py Proyecto: vgotra/FSND
class Movie(db.Model):
    __tablename__ = "movies"

    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(100), nullable=False)
    description = db.Column(db.String(300))
    release_date = db.Column(db.Date)
    release_country = db.Column(db.String(50))
    genres = db.relationship("Genre",
                             secondary=movie_genre_table,
                             back_populates="movies",
                             lazy="joined")
    languages = db.relationship("Language",
                                secondary=movie_language_table,
                                back_populates="movies",
                                lazy="joined")
Ejemplo n.º 5
0
class Language(db.Model):
    __tablename__ = "languages"

    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(50), nullable=False)
    movies = db.relationship("Movie",
                             secondary=movie_language_table,
                             back_populates="languages")
Ejemplo n.º 6
0
class Artist(db.Model):
    __tablename__ = 'Artists'

    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String)
    phone = db.Column(db.String(120))
    website_link = db.Column(db.String(500))
    image_link = db.Column(db.String(500))
    facebook_link = db.Column(db.String(120))
    seeking_venue = db.Column(db.Boolean)
    seeking_description = db.Column(db.String(500))
    city_id = db.Column(db.Integer, db.ForeignKey('Cities.id'), nullable=False)
    city = db.relationship('City', back_populates='artists', lazy='joined')
    shows = db.relationship('Show', back_populates='artist', lazy='joined')
    genres = db.relationship("Genre",
                             secondary=artistgenre_table,
                             back_populates="artists",
                             lazy='joined')