Archived
7
0
This repository has been archived on 2025-03-19. You can view files and clone it, but cannot push or open issues or pull requests.
Files
vafling/waffles/models.py
Ilse Visser a246b0fbb6 Add classes to models
Create a new app, mercantile, which takes care of everything related to
money and calculations. Add classes and variables to the models of
both waffles and mercantile.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Your branch is up-to-date with 'origin/master'.
#
# Changes to be committed:
#	new file:   mercantile/.models.py.swp
#	new file:   mercantile/__init__.py
#	new file:   mercantile/admin.py
#	new file:   mercantile/migrations/__init__.py
#	new file:   mercantile/models.py
#	new file:   mercantile/tests.py
#	new file:   mercantile/views.py
#	modified:   waffles/models.py
#
# Changes not staged for commit:
#	modified:   .gitignore
#
2015-08-16 15:42:28 +02:00

49 lines
1.2 KiB
Python

from django.contrib.auth.models import AbstractUser
from django.db import models
# Create your models here.
class UserProfile(AbstractUser):
pass
class Community(models.Model):
name = models.CharField(max_length=64)
members = models.ManyToManyField(UserProfile)
# Jeg har lyst til å vafle!
# Er det noen som er med?
class Listing(models.Model):
community = models.ForeignKey(Community)
timeFrom = models.DateTimeField()
timeTo = models.DateTimeField()
user = models.ForeignKey(UserProfile)
description = models.TextField()
class Event(models.Model):
name = models.CharField(max_length=64)
description = models.TextField()
status = models.BooleanField() # closed - no more edits
participants = models.ManyToManyField(UserProfile)
timeFrom = models.DateTimeField()
timeTo = models.DateTimeField()
class Subevent(models.Model):
name = models.CharField(max_length=64)
participants = models.ManyToManyField(UserProfile)
event = models.ForeignKey(Event)
class ShoppingList(models.Model):
name = models.CharField(max_length=64)
price = models.IntField
payers = models.ManyToManyField(UserProfile)
subevent = models.ForeignKey(Subevent)