Download api/app/user/models.py from iBrokeTheCode/Image_Classifier_with_CNN: direct link, hf CLI and curl.
- Browser
- Download file 694 Bytes
-
https://huggingface.co/spaces/iBrokeTheCode/Image_Classifier_with_CNN/resolve/3ce4bfcd092cc1d5f518baf6ca367ffa336d7d75/api/app/user/models.py
- Command line
-
hf download hf://spaces/iBrokeTheCode/Image_Classifier_with_CNN@3ce4bfcd092cc1d5f518baf6ca367ffa336d7d75/api/app/user/models.py
-
curl -L -o models.py https://huggingface.co/spaces/iBrokeTheCode/Image_Classifier_with_CNN/resolve/3ce4bfcd092cc1d5f518baf6ca367ffa336d7d75/api/app/user/models.py
694 Bytes
| from app.db import Base | |
| from sqlalchemy import Column, Integer, String | |
| from sqlalchemy.orm import relationship | |
| from . import hashing | |
| class User(Base): | |
| __tablename__ = "users" | |
| id = Column(Integer, primary_key=True, index=True) | |
| name = Column(String(50)) | |
| email = Column(String(255), unique=True) | |
| password = Column(String(255)) | |
| feedbacks = relationship("Feedback", back_populates="user") | |
| def __init__(self, name, email, password, *args, **kwargs): | |
| self.name = name | |
| self.email = email | |
| self.password = hashing.get_password_hash(password) | |
| def check_password(self, password): | |
| return hashing.verify_password(self.password, password) | |