Skip to content
Snippets Groups Projects
Commit 863023eb authored by arwunder's avatar arwunder
Browse files

Merge branch 'fix-objectID-error' into 'main'

added ObjectId import

See merge request !26
parents 310d4ef7 74abf4c3
No related branches found
No related tags found
1 merge request!26added ObjectId import
Pipeline #14794 passed
......@@ -12,11 +12,13 @@ from mongoengine import (
)
from flask_login import UserMixin
from bson import ObjectId
class User(UserMixin, db.Document):
"""
Model representing a user of the auction site.
"""
id: ObjectId
email = EmailField(required=True, unique=True)
......@@ -49,6 +51,14 @@ class Item(db.Document):
"""
A model for items that are listed on the auction site.
"""
# Create index for sorting items by closing date
meta = {"indexes": [
{"fields": [
"closes_at",
]}
]}
title = StringField(max_length=100, required=True)
......
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