<commit_before>"""Models for bucketlist API V1."""


class User:
    """."""

    pass


class BucketItem:
    """."""

    pass<commit_msg>[Feature] Add user model<commit_after>"""Models for bucketlist API V1."""
from app.database import Base
from sqlalchemy import Column, Integer, String
from werkzeug.security import generate_password_hash, check_password_hash


class User(Base):
    """Defines the user table and operations allowed."""

    __tablename__ = 'users'
    id = Column(Integer, primary_key=True)
    username = Column(String(50), unique=True)
    password_hash = Column(String(128))

    @property
    def username(self):
        return self.username

    @property
    def password(self):
        raise AttributeError('password is not a readable attribute')

    @property.setter
    def password(self, password):
        self.password_hash = generate_password_hash(password)

    def verify(self, password):
        return check_password_hash(self.password_hash, password)

    def __repr__(self):
        return '<User %r>' % self.username




class BucketItem:
    """."""

    pass
{'fraction_non_alphanumeric': 0.1105072463768116, 'fraction_numerical': 0.006340579710144928, 'mean_word_length': 3.510204081632653, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6045434', 'n_tokens_mistral': 327, 'n_tokens_neox': 306, 'n_words': 88}