Skip to content
Snippets Groups Projects
Commit 61dc475e authored by Arno Wunderlich's avatar Arno Wunderlich
Browse files

setup for testing of db

parent bde0af60
No related branches found
No related tags found
1 merge request!5Db init
Pipeline #13336 passed
......@@ -164,4 +164,5 @@ cython_debug/
_docs/
.env
dotenv
.DS_Store
......@@ -14,9 +14,4 @@
# developers or deployments, as you can simply share the .env file rather than hardcoding the
# values into the application itself.
FLASK_APP=tjts5901.app
FLASK_DEBUG=1
# Enable rich logging for more human readable log output. Requires installing
# `rich` and `flask-rich` packages.
#RICH_LOGGING=1
MONGO_URL = "mongodb://localhost:27017/
\ No newline at end of file
from datetime import datetime
from .db import db
from mongoengine import (
StringField,
IntField,
ReferenceField,
DateTimeField,
EmailField,
)
class User(db.Document):
"""
Model representing a user of the auction site.
"""
email = EmailField(required=True, unique=True)
password = StringField(required=True)
created_at = DateTimeField(required=True, default=datetime.utcnow)
class Item(db.Document):
"""
A model for items that are listed on the auction site.
"""
title = StringField(max_length=100, required=True)
description = StringField(max_length=2000, required=True)
starting_bid = IntField(required=True, min_value=0)
seller = ReferenceField(User, required=True)
created_at = DateTimeField(required=True, default=datetime.utcnow)
closes_at = DateTimeField()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment