Skip to content

Commit ff48c35

Browse files
committed
Refactor Users model in users.py to improve code organization and add column definitions
1 parent 2b18362 commit ff48c35

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

app/Models/users.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
from sqlalchemy import Column, String
22
from database.db import BaseModel
33

4+
# Define the Users model class, inheriting from BaseModel
45
class Users(BaseModel):
5-
__tablename__ = 'users'
6+
__tablename__ = 'users' # Define the table name
67

7-
name = Column(String, index=True)
8-
email = Column(String, unique=True, index=True)
9-
password = Column(String)
8+
name = Column(String, index=True) # Define the name column
9+
email = Column(String, unique=True, index=True) # Define the email column
10+
password = Column(String) # Define the password column
1011

12+
# Define a string representation for the Users model
1113
def __repr__(self):
1214
return f"<User(name={self.name}, email={self.email})>"

0 commit comments

Comments
 (0)