Перенесено из репозитария SpecialistOff.NET
This commit is contained in:
25
myapp/models/users.py
Normal file
25
myapp/models/users.py
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: UTF-8 -*-
|
||||
|
||||
__author__ = 'RemiZOffAlex'
|
||||
__copyright__ = '(c) RemiZOffAlex'
|
||||
__license__ = 'MIT'
|
||||
__email__ = 'remizoffalex@mail.ru'
|
||||
|
||||
import datetime
|
||||
from sqlalchemy import Table, Column, Boolean, Integer, ForeignKey, String, DateTime
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
from . import Base
|
||||
|
||||
class User(Base):
|
||||
__tablename__ = "user"
|
||||
|
||||
id = Column(Integer, primary_key=True)
|
||||
name = Column(String, nullable=False, unique=True)
|
||||
password = Column(String, nullable=False)
|
||||
created = Column(DateTime)
|
||||
|
||||
def __init__(self, name):
|
||||
self.name = name
|
||||
self.created = datetime.datetime.utcnow()
|
||||
Reference in New Issue
Block a user