Skip to content

Commit 88552e3

Browse files
committed
Revert "models.py"
This reverts commit ddb9115.
1 parent ddb9115 commit 88552e3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

stregsystem/models.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from abc import abstractmethod
44
from collections import Counter
55
from email.utils import parseaddr
6+
from datetime import datetime
67

78
from django.contrib.admin.models import LogEntry, ADDITION, CHANGE
89
from django.contrib.auth.models import User
@@ -44,16 +45,17 @@ class NoMoreInventoryError(Exception):
4445
pass
4546

4647

47-
4848
# Create your models here.
4949

50+
5051
class BaseModel(models.Model):
5152
created_at = models.DateTimeField(auto_now_add=True)
5253
updated_at = models.DateTimeField(auto_now=True)
5354

5455
class Meta:
5556
abstract = True
5657

58+
5759
# So we have two "basic" operations to do with money
5860
# we can take money from a user and we can give them money
5961
# the class names here are written from the perspective of
@@ -99,7 +101,8 @@ def __init__(self, product, order, count):
99101

100102
def price(self):
101103
return self.product.price * self.count
102-
104+
105+
103106
class Order(object):
104107
def __init__(self, member, room, items=None):
105108
self.member = member
@@ -688,6 +691,7 @@ class Sale(BaseModel):
688691
room = models.ForeignKey(Room, on_delete=models.CASCADE, null=True)
689692
timestamp = models.DateTimeField(auto_now_add=True)
690693
price = models.IntegerField()
694+
691695
class Meta(BaseModel.Meta):
692696
index_together = [
693697
["product", "timestamp"],

0 commit comments

Comments
 (0)