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

added Bid db model

parent c66b7de6
No related branches found
No related tags found
1 merge request!38Create rest api
......@@ -94,6 +94,33 @@ class Item(db.Document):
return self.closes_at > datetime.utcnow()
class Bid(db.Document):
"""
A model for bids on items.
"""
meta = {"indexes": [
{"fields": [
"amount",
"item",
"created_at",
]}
]}
amount = IntField(required=True, min_value=0)
"Indicates the value of the bid."
bidder = ReferenceField(User, required=True)
"User who placed the bid."
item = ReferenceField(Item, required=True)
"Item that the bid is for."
created_at = DateTimeField(required=True, default=datetime.utcnow)
"Date and time that the bid was placed."
class AccessToken(db.Document):
"""
Access token for a user.
......
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