Skip to content

Table inheritance? #26

Open
Open

Description

@fantix
No description provided.

Activity

  1. added this to the milestone on Sep 3, 2017
  2. aprilmay commented on May 21, 2018

    @aprilmay

    Using table model inheritance flawlessly here :)

  3. fantix commented on May 21, 2018

    @fantix
    MemberAuthor

    Sorry just edited my reply - do you mind sharing your example please? I just tried and it's not working:

    class Vehicle(db.Model):
        __tablename__ = 'vehicles'
    
        id = db.Column(db.BigInteger(), primary_key=True)
        seats = db.Column(db.Integer())
    
    
    class Van(Vehicle):
        __tablename__ = 'vans'
    
        capacity = db.Column(db.Unicode())
    
    print(Van.__table__.name)  # vehicles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedquestionA community question, closed when inactive.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions