Program/mooc/models/profile_fields.py
?..濡.. 0e27355932 Refactor models and schemas for improved consistency and functionality
- Updated import statements in `mooc/models/__init__.py` to use parentheses for clarity.
- Refactored `mooc/models/core.py` to replace `UnsignedInteger` with `INTEGER(unsigned=True)` for better compatibility.
- Introduced new `MobileNumber` model in `mooc/models/mobile_number.py` with appropriate fields.
- Added `ProfileFields` model in `mooc/models/profile_fields.py` with detailed attributes.
- Updated schemas in `mooc/schemas/mobile_number.py` and `mooc/schemas/profile_fields.py` to reflect model changes and improve naming conventions.
- Ensured all models and schemas are consistent with naming and data types.
2025-01-09 06:43:18 +08:00

21 lines
806 B
Python

from sqlalchemy import Column, Integer, String, SmallInteger, Boolean
from sqlalchemy.dialects.mysql import INTEGER, TINYINT
from mooc.db.database import Base
class ProfileFields(Base):
__tablename__ = "ims_profile_fields"
id = Column(INTEGER(unsigned=True), primary_key=True)
field = Column(String(255), nullable=False)
available = Column(TINYINT(1), nullable=False)
title = Column(String(255), nullable=False)
description = Column(String(255), nullable=False)
displayorder = Column(SmallInteger, nullable=False)
required = Column(TINYINT(1), nullable=False)
unchangeable = Column(TINYINT(1), nullable=False)
showinregister = Column(TINYINT(1), nullable=False)
field_length = Column(Integer, nullable=False)
class Config:
from_attributes = True