Download models/user.py from Fred808/NNT2: direct link, hf CLI and curl.
- Browser
- Download file 482 Bytes
-
https://huggingface.co/spaces/Fred808/NNT2/resolve/main/models/user.py
- Command line
-
hf download hf://spaces/Fred808/NNT2/models/user.py
-
curl -L -o user.py https://huggingface.co/spaces/Fred808/NNT2/resolve/main/models/user.py
482 Bytes
| from flask_sqlalchemy import SQLAlchemy | |
| db = SQLAlchemy() | |
| class User(db.Model): | |
| id = db.Column(db.Integer, primary_key=True) | |
| username = db.Column(db.String(80), unique=True, nullable=False) | |
| email = db.Column(db.String(120), unique=True, nullable=False) | |
| def __repr__(self): | |
| return f'<User {self.username}>' | |
| def to_dict(self): | |
| return { | |
| 'id': self.id, | |
| 'username': self.username, | |
| 'email': self.email | |
| } | |