hanabiapp.models.game_survey

 1from .. import db
 2from .user import User
 3
 4class GameSurvey(db.Model):
 5    """
 6    ゲームに関するアンケートデータをデータベースに保存するためのモデル.
 7
 8    Attributes:
 9        id (int): アンケートの一意の識別子
10        user_id (int): 回答者のユーザーID(`user.id` への外部キー)
11        game_id (int): 関連するゲームのID(`game_info.id` への外部キー)
12        question_id (str): 質問の識別子
13        answer_id (str): 回答の識別子
14    """
15    __tablename__ = 'game_survey'
16    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
17    user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)
18    game_id = db.Column(db.Integer, db.ForeignKey('game_info.id'), nullable=False)
19    
20    question_id = db.Column(db.Text, nullable=False)
21    answer_id = db.Column(db.Text, nullable=False)
class GameSurvey(sqlalchemy.orm.decl_api._DynamicAttributesType, sqlalchemy.inspection.Inspectable[sqlalchemy.orm.mapper.Mapper[typing.Any]]):
 5class GameSurvey(db.Model):
 6    """
 7    ゲームに関するアンケートデータをデータベースに保存するためのモデル.
 8
 9    Attributes:
10        id (int): アンケートの一意の識別子
11        user_id (int): 回答者のユーザーID(`user.id` への外部キー)
12        game_id (int): 関連するゲームのID(`game_info.id` への外部キー)
13        question_id (str): 質問の識別子
14        answer_id (str): 回答の識別子
15    """
16    __tablename__ = 'game_survey'
17    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
18    user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)
19    game_id = db.Column(db.Integer, db.ForeignKey('game_info.id'), nullable=False)
20    
21    question_id = db.Column(db.Text, nullable=False)
22    answer_id = db.Column(db.Text, nullable=False)

ゲームに関するアンケートデータをデータベースに保存するためのモデル.

Attributes:
  • id (int): アンケートの一意の識別子
  • user_id (int): 回答者のユーザーID(user.id への外部キー)
  • game_id (int): 関連するゲームのID(game_info.id への外部キー)
  • question_id (str): 質問の識別子
  • answer_id (str): 回答の識別子
GameSurvey(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance's class are allowed. These could be, for example, any mapped columns or relationships.

id
user_id
game_id
question_id
answer_id