Skip to content
Snippets Groups Projects
Commit dc8ed3d1 authored by Teemu Autto's avatar Teemu Autto
Browse files

Added a model for bid.

parent b5126eff
No related branches found
No related tags found
No related merge requests found
...@@ -51,3 +51,21 @@ class Item(db.Document): ...@@ -51,3 +51,21 @@ class Item(db.Document):
Return whether the item is open for bidding. Return whether the item is open for bidding.
""" """
return self.closes_at > datetime.utcnow() return self.closes_at > datetime.utcnow()
class Bid(db.Document):
"""
A model for bids on items.
"""
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."
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