Translations
This commit is contained in:
parent
fbb1c53dd0
commit
e66db0b857
2
.gitignore
vendored
2
.gitignore
vendored
@ -45,7 +45,7 @@ coverage.xml
|
|||||||
*,cover
|
*,cover
|
||||||
|
|
||||||
# Translations
|
# Translations
|
||||||
*.mo
|
#*.mo We need them for dev-purposes for now.
|
||||||
*.pot
|
*.pot
|
||||||
|
|
||||||
# Django stuff:
|
# Django stuff:
|
||||||
|
BIN
mercantile/locale/nb/LC_MESSAGES/django.mo
Normal file
BIN
mercantile/locale/nb/LC_MESSAGES/django.mo
Normal file
Binary file not shown.
71
mercantile/locale/nb/LC_MESSAGES/django.po
Normal file
71
mercantile/locale/nb/LC_MESSAGES/django.po
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
# SOME DESCRIPTIVE TITLE.
|
||||||
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||||
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||||
|
#
|
||||||
|
#, fuzzy
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2015-08-16 21:18+0200\n"
|
||||||
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
"Language: \n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#: models.py:13 models.py:28 models.py:42
|
||||||
|
msgid "Amount owed"
|
||||||
|
msgstr "Sum skyldt"
|
||||||
|
|
||||||
|
#: models.py:14
|
||||||
|
msgid "Debtor"
|
||||||
|
msgstr "Skylder"
|
||||||
|
|
||||||
|
#: models.py:15
|
||||||
|
msgid "Debtee"
|
||||||
|
msgstr "Kreditor"
|
||||||
|
|
||||||
|
#: models.py:18
|
||||||
|
msgid "Total debt"
|
||||||
|
msgstr "Sammenlagt gjeld"
|
||||||
|
|
||||||
|
#: models.py:19
|
||||||
|
msgid "Total debts"
|
||||||
|
msgstr "Sammenlagte gjelder"
|
||||||
|
|
||||||
|
#: models.py:26 models.py:40
|
||||||
|
msgid "Connected debt"
|
||||||
|
msgstr "Tilhørende gjeld"
|
||||||
|
|
||||||
|
#: models.py:27
|
||||||
|
msgid "Connected event"
|
||||||
|
msgstr "Tilhørende event"
|
||||||
|
|
||||||
|
#: models.py:29
|
||||||
|
msgid "Date integrated"
|
||||||
|
msgstr "Dato integrert"
|
||||||
|
|
||||||
|
#: models.py:32
|
||||||
|
msgid "Calculation"
|
||||||
|
msgstr "Kalkulering"
|
||||||
|
|
||||||
|
#: models.py:33
|
||||||
|
msgid "Calculations"
|
||||||
|
msgstr "Kalkuleringer"
|
||||||
|
|
||||||
|
#: models.py:41
|
||||||
|
msgid "Date made"
|
||||||
|
msgstr "Dato gjort"
|
||||||
|
|
||||||
|
#: models.py:45
|
||||||
|
msgid "Cash settlement"
|
||||||
|
msgstr "Kontantoppgjør"
|
||||||
|
|
||||||
|
#: models.py:46
|
||||||
|
msgid "Cash settlements"
|
||||||
|
msgstr "Kontantoppgjør"
|
@ -1,28 +1,47 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from waffles.models import Event, UserProfile
|
from waffles.models import Event, UserProfile
|
||||||
|
|
||||||
|
|
||||||
# Create your models here.
|
|
||||||
|
|
||||||
|
|
||||||
class Debt(models.Model):
|
class Debt(models.Model):
|
||||||
amount = models.BigIntegerField()
|
"""
|
||||||
debtor = models.ForeignKey(UserProfile, related_name="debtor")
|
The total debt owed by debtor to debtee.
|
||||||
debtee = models.ForeignKey(UserProfile, related_name="debtee")
|
|
||||||
|
If system is consistent this will be the sum of calculation.amount
|
||||||
|
and settlement.amount
|
||||||
|
"""
|
||||||
|
amount = models.BigIntegerField(verbose_name=_("Amount owed"))
|
||||||
|
debtor = models.ForeignKey(UserProfile, related_name="debtor", verbose_name=_("Debtor"))
|
||||||
|
debtee = models.ForeignKey(UserProfile, related_name="debtee", verbose_name=_("Debtee"))
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = _('Total debt')
|
||||||
|
verbose_name_plural = _('Total debts')
|
||||||
|
|
||||||
|
|
||||||
# oversikt over oppgjør, for logging
|
|
||||||
class Calculation(models.Model):
|
class Calculation(models.Model):
|
||||||
debt = models.ForeignKey(Debt)
|
"""
|
||||||
event = models.ForeignKey(Event)
|
This is a single calculation of debt from an event.
|
||||||
date = models.DateTimeField()
|
"""
|
||||||
|
debt = models.ForeignKey(Debt, verbose_name=_("Connected debt"))
|
||||||
|
event = models.ForeignKey(Event, _("Connected event"))
|
||||||
|
amount = models.IntegerField(verbose_name=_("Amount owed"))
|
||||||
|
date = models.DateTimeField(verbose_name=_("Date integrated"))
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = _('Calculation')
|
||||||
|
verbose_name_plural = _('Calculations')
|
||||||
|
|
||||||
|
|
||||||
# Lagring av oppgjør
|
|
||||||
class Settlement(models.Model):
|
class Settlement(models.Model):
|
||||||
debt = models.ForeignKey(Debt)
|
"""
|
||||||
dato = models.DateField()
|
When part of or a whole debt is settled in 'cash'
|
||||||
amount = models.IntegerField()
|
"""
|
||||||
|
debt = models.ForeignKey(Debt, verbose_name=_("Connected debt"))
|
||||||
|
date = models.DateField(verbose_name=_("Date made"))
|
||||||
|
amount = models.IntegerField(verbose_name=_("Amount owed"))
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = _('Cash settlement')
|
||||||
|
verbose_name_plural = _('Cash settlements')
|
||||||
|
@ -87,9 +87,9 @@ DATABASES = {
|
|||||||
# Internationalization
|
# Internationalization
|
||||||
# https://docs.djangoproject.com/en/1.8/topics/i18n/
|
# https://docs.djangoproject.com/en/1.8/topics/i18n/
|
||||||
|
|
||||||
LANGUAGE_CODE = 'en-us'
|
LANGUAGE_CODE = 'nb-no'
|
||||||
|
|
||||||
TIME_ZONE = 'UTC'
|
TIME_ZONE = 'CET'
|
||||||
|
|
||||||
USE_I18N = True
|
USE_I18N = True
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
from .models import UserProfile, Community, Event, Listing, ShoppingList, Subevent
|
from .models import UserProfile, Community, Event, Listing, ShoppingList, SubEvent
|
||||||
|
|
||||||
|
|
||||||
# Register your models here.
|
# Register your models here.
|
||||||
|
|
||||||
|
|
||||||
@admin.register(UserProfile, Community, Event, Listing, ShoppingList, Subevent)
|
@admin.register(UserProfile, Community, Event, Listing, ShoppingList, SubEvent)
|
||||||
class GenericAdmin(admin.ModelAdmin):
|
class GenericAdmin(admin.ModelAdmin):
|
||||||
pass
|
pass
|
||||||
|
BIN
waffles/locale/nb/LC_MESSAGES/django.mo
Normal file
BIN
waffles/locale/nb/LC_MESSAGES/django.mo
Normal file
Binary file not shown.
123
waffles/locale/nb/LC_MESSAGES/django.po
Normal file
123
waffles/locale/nb/LC_MESSAGES/django.po
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
# SOME DESCRIPTIVE TITLE.
|
||||||
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||||
|
# This file is distributed under the same license as the PACKAGE package.
|
||||||
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||||
|
#
|
||||||
|
#, fuzzy
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2015-08-16 21:17+0200\n"
|
||||||
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
"Language: \n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#: models.py:13
|
||||||
|
msgid "User profile"
|
||||||
|
msgstr "Brukerprofil"
|
||||||
|
|
||||||
|
#: models.py:14
|
||||||
|
msgid "User profiles"
|
||||||
|
msgstr "Bruerprofiler"
|
||||||
|
|
||||||
|
#: models.py:24
|
||||||
|
msgid "Community name"
|
||||||
|
msgstr "Community navn"
|
||||||
|
|
||||||
|
#: models.py:25
|
||||||
|
msgid "Community members"
|
||||||
|
msgstr "Community medlemmer"
|
||||||
|
|
||||||
|
#: models.py:28 models.py:38
|
||||||
|
msgid "Community"
|
||||||
|
msgstr "Community"
|
||||||
|
|
||||||
|
#: models.py:29
|
||||||
|
msgid "Communities"
|
||||||
|
msgstr "Communitier"
|
||||||
|
|
||||||
|
#: models.py:39 models.py:60
|
||||||
|
msgid "Start time"
|
||||||
|
msgstr "Starttid"
|
||||||
|
|
||||||
|
#: models.py:40 models.py:61
|
||||||
|
msgid "End time"
|
||||||
|
msgstr "Sluttid"
|
||||||
|
|
||||||
|
#: models.py:41
|
||||||
|
msgid "Requesting user"
|
||||||
|
msgstr "Forespørrende bruker"
|
||||||
|
|
||||||
|
#: models.py:42 models.py:56
|
||||||
|
msgid "Description/text"
|
||||||
|
msgstr "Beskrivelse/tekst"
|
||||||
|
|
||||||
|
#: models.py:45 models.py:46
|
||||||
|
msgid "Listing"
|
||||||
|
msgstr "Forespørsel"
|
||||||
|
|
||||||
|
#: models.py:55
|
||||||
|
msgid "Event name"
|
||||||
|
msgstr "Event navn"
|
||||||
|
|
||||||
|
#: models.py:57
|
||||||
|
msgid "Open for new participants"
|
||||||
|
msgstr "Åpen for nye deltakere"
|
||||||
|
|
||||||
|
#: models.py:58
|
||||||
|
msgid "Finalized"
|
||||||
|
msgstr "Avsluttet"
|
||||||
|
|
||||||
|
#: models.py:59 models.py:75
|
||||||
|
msgid "Participants"
|
||||||
|
msgstr "Deltakere"
|
||||||
|
|
||||||
|
#: models.py:64
|
||||||
|
msgid "Event"
|
||||||
|
msgstr "Event"
|
||||||
|
|
||||||
|
#: models.py:65
|
||||||
|
msgid "Events"
|
||||||
|
msgstr "Eventer"
|
||||||
|
|
||||||
|
#: models.py:74 models.py:89
|
||||||
|
msgid "Name"
|
||||||
|
msgstr "Navn"
|
||||||
|
|
||||||
|
#: models.py:76
|
||||||
|
msgid "Parent event"
|
||||||
|
msgstr "Overordnet event"
|
||||||
|
|
||||||
|
#: models.py:79
|
||||||
|
msgid "Sub Event"
|
||||||
|
msgstr "Underevent"
|
||||||
|
|
||||||
|
#: models.py:80
|
||||||
|
msgid "Sub Events"
|
||||||
|
msgstr "Undereventer"
|
||||||
|
|
||||||
|
#: models.py:90
|
||||||
|
msgid "Price"
|
||||||
|
msgstr "Pris"
|
||||||
|
|
||||||
|
#: models.py:91
|
||||||
|
msgid "Payers"
|
||||||
|
msgstr "Betalt av"
|
||||||
|
|
||||||
|
#: models.py:92
|
||||||
|
msgid "Connected sub-event"
|
||||||
|
msgstr "Tilhørende subevent"
|
||||||
|
|
||||||
|
#: models.py:95
|
||||||
|
msgid "Shopping list"
|
||||||
|
msgstr "Handleliste"
|
||||||
|
|
||||||
|
#: models.py:96
|
||||||
|
msgid "Shopping lists"
|
||||||
|
msgstr "Hendlelister"
|
148
waffles/migrations/0003_auto_20150816_2109.py
Normal file
148
waffles/migrations/0003_auto_20150816_2109.py
Normal file
@ -0,0 +1,148 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import datetime
|
||||||
|
|
||||||
|
from django.db import models, migrations
|
||||||
|
from django.utils.timezone import utc
|
||||||
|
from django.conf import settings
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
dependencies = [
|
||||||
|
('waffles', '0002_auto_20150816_1357'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name='community',
|
||||||
|
options={'verbose_name': 'Community', 'verbose_name_plural': 'Communities'},
|
||||||
|
),
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name='event',
|
||||||
|
options={'verbose_name': 'Event', 'verbose_name_plural': 'Events'},
|
||||||
|
),
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name='listing',
|
||||||
|
options={'verbose_name': 'Listing', 'verbose_name_plural': 'Listing'},
|
||||||
|
),
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name='shoppinglist',
|
||||||
|
options={'verbose_name': 'Shopping list', 'verbose_name_plural': 'Shopping lists'},
|
||||||
|
),
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name='subevent',
|
||||||
|
options={'verbose_name': 'Sub Event', 'verbose_name_plural': 'Sub Events'},
|
||||||
|
),
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name='userprofile',
|
||||||
|
options={'verbose_name': 'User profile', 'verbose_name_plural': 'User profiles'},
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='event',
|
||||||
|
name='open',
|
||||||
|
field=models.BooleanField(default=datetime.datetime(2015, 8, 16, 19, 9, 38, 507600, tzinfo=utc),
|
||||||
|
verbose_name='Open for new participants'),
|
||||||
|
preserve_default=False,
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='community',
|
||||||
|
name='members',
|
||||||
|
field=models.ManyToManyField(to=settings.AUTH_USER_MODEL, db_constraint='Community members'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='community',
|
||||||
|
name='name',
|
||||||
|
field=models.CharField(verbose_name='Community name', max_length=64),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='event',
|
||||||
|
name='description',
|
||||||
|
field=models.TextField(verbose_name='Description/text'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='event',
|
||||||
|
name='name',
|
||||||
|
field=models.CharField(verbose_name='Event name', max_length=64),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='event',
|
||||||
|
name='participants',
|
||||||
|
field=models.ManyToManyField(verbose_name='Participants', to=settings.AUTH_USER_MODEL),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='event',
|
||||||
|
name='status',
|
||||||
|
field=models.BooleanField(verbose_name='Finalized'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='event',
|
||||||
|
name='timeFrom',
|
||||||
|
field=models.DateTimeField(verbose_name='Start time'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='event',
|
||||||
|
name='timeTo',
|
||||||
|
field=models.DateTimeField(verbose_name='End time'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='listing',
|
||||||
|
name='community',
|
||||||
|
field=models.ForeignKey(to='waffles.Community', verbose_name='Community'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='listing',
|
||||||
|
name='description',
|
||||||
|
field=models.TextField(verbose_name='Description/text'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='listing',
|
||||||
|
name='timeFrom',
|
||||||
|
field=models.DateTimeField(verbose_name='Start time'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='listing',
|
||||||
|
name='timeTo',
|
||||||
|
field=models.DateTimeField(verbose_name='End time'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='listing',
|
||||||
|
name='user',
|
||||||
|
field=models.ForeignKey(to=settings.AUTH_USER_MODEL, verbose_name='Requesting user'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='shoppinglist',
|
||||||
|
name='name',
|
||||||
|
field=models.CharField(verbose_name='Name', max_length=64),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='shoppinglist',
|
||||||
|
name='payers',
|
||||||
|
field=models.ManyToManyField(to=settings.AUTH_USER_MODEL, db_constraint='Payers'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='shoppinglist',
|
||||||
|
name='price',
|
||||||
|
field=models.IntegerField(verbose_name='Price'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='shoppinglist',
|
||||||
|
name='subevent',
|
||||||
|
field=models.ForeignKey(to='waffles.SubEvent', to_field='Connected sub-event'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='subevent',
|
||||||
|
name='event',
|
||||||
|
field=models.ForeignKey(to='waffles.Event', to_field='Parent event'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='subevent',
|
||||||
|
name='name',
|
||||||
|
field=models.CharField(verbose_name='Name', max_length=64),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='subevent',
|
||||||
|
name='participants',
|
||||||
|
field=models.ManyToManyField(to=settings.AUTH_USER_MODEL, db_constraint='Participants'),
|
||||||
|
),
|
||||||
|
]
|
@ -1,48 +1,96 @@
|
|||||||
from django.contrib.auth.models import AbstractUser
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
from django.contrib.auth.models import AbstractUser
|
||||||
|
from django.utils.translation import ugettext_lazy as _
|
||||||
# Create your models here.
|
|
||||||
|
|
||||||
|
|
||||||
class UserProfile(AbstractUser):
|
class UserProfile(AbstractUser):
|
||||||
|
"""
|
||||||
|
User profile
|
||||||
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = _('User profile')
|
||||||
|
verbose_name_plural = _('User profiles')
|
||||||
|
|
||||||
|
|
||||||
class Community(models.Model):
|
class Community(models.Model):
|
||||||
name = models.CharField(max_length=64)
|
"""
|
||||||
members = models.ManyToManyField(UserProfile)
|
Community
|
||||||
|
|
||||||
|
It works kind of like a django group, but is intended to
|
||||||
|
grow more complex over time.
|
||||||
|
"""
|
||||||
|
name = models.CharField(max_length=64, verbose_name=_("Community name"))
|
||||||
|
members = models.ManyToManyField(UserProfile, _("Community members"))
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = _('Community')
|
||||||
|
verbose_name_plural = _('Communities')
|
||||||
|
|
||||||
|
|
||||||
# Jeg har lyst til å vafle!
|
|
||||||
# Er det noen som er med?
|
|
||||||
class Listing(models.Model):
|
class Listing(models.Model):
|
||||||
community = models.ForeignKey(Community)
|
"""
|
||||||
timeFrom = models.DateTimeField()
|
Listing requesting interest in creating an event.
|
||||||
timeTo = models.DateTimeField()
|
|
||||||
user = models.ForeignKey(UserProfile)
|
Supposed to be removed and replaced with an event when someone answers it.
|
||||||
description = models.TextField()
|
"""
|
||||||
|
community = models.ForeignKey(Community, verbose_name=_("Community"))
|
||||||
|
timeFrom = models.DateTimeField(verbose_name=_("Start time"))
|
||||||
|
timeTo = models.DateTimeField(verbose_name=_("End time"))
|
||||||
|
user = models.ForeignKey(UserProfile, verbose_name=_("Requesting user"))
|
||||||
|
description = models.TextField(verbose_name=_("Description/text"))
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = _('Listing')
|
||||||
|
verbose_name_plural = _('Listing')
|
||||||
|
|
||||||
|
|
||||||
class Event(models.Model):
|
class Event(models.Model):
|
||||||
name = models.CharField(max_length=64)
|
"""
|
||||||
description = models.TextField()
|
Event
|
||||||
status = models.BooleanField() # closed - no more edits
|
|
||||||
participants = models.ManyToManyField(UserProfile)
|
A loose collection of participants at a location at a given time
|
||||||
timeFrom = models.DateTimeField()
|
"""
|
||||||
timeTo = models.DateTimeField()
|
name = models.CharField(max_length=64, verbose_name=_("Event name"))
|
||||||
|
description = models.TextField(verbose_name=_("Description/text"))
|
||||||
|
open = models.BooleanField(verbose_name=_("Open for new participants"))
|
||||||
|
status = models.BooleanField(verbose_name=_("Finalized"))
|
||||||
|
participants = models.ManyToManyField(UserProfile, verbose_name=_("Participants"))
|
||||||
|
timeFrom = models.DateTimeField(verbose_name=_("Start time"))
|
||||||
|
timeTo = models.DateTimeField(verbose_name=_("End time"))
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = _('Event')
|
||||||
|
verbose_name_plural = _('Events')
|
||||||
|
|
||||||
|
|
||||||
class Subevent(models.Model):
|
class SubEvent(models.Model):
|
||||||
name = models.CharField(max_length=64)
|
"""
|
||||||
participants = models.ManyToManyField(UserProfile)
|
Used to group parts of an event into smaller groups.
|
||||||
event = models.ForeignKey(Event)
|
|
||||||
|
Used when not everyone is participating in the entire event.
|
||||||
|
"""
|
||||||
|
name = models.CharField(max_length=64, verbose_name=_("Name"))
|
||||||
|
participants = models.ManyToManyField(UserProfile, _("Participants"))
|
||||||
|
event = models.ForeignKey(Event, _("Parent event"))
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = _('Sub Event')
|
||||||
|
verbose_name_plural = _('Sub Events')
|
||||||
|
|
||||||
|
|
||||||
class ShoppingList(models.Model):
|
class ShoppingList(models.Model):
|
||||||
name = models.CharField(max_length=64)
|
"""
|
||||||
price = models.IntegerField()
|
Item to be bought or bought to the sub-event
|
||||||
payers = models.ManyToManyField(UserProfile)
|
|
||||||
subevent = models.ForeignKey(Subevent)
|
|
||||||
|
|
||||||
|
The reason for using sub-events. Any responsibilities and duties here are isolated within the sub-event.
|
||||||
|
"""
|
||||||
|
name = models.CharField(max_length=64, verbose_name=_("Name"))
|
||||||
|
price = models.IntegerField(verbose_name=_("Price"))
|
||||||
|
payers = models.ManyToManyField(UserProfile, _("Payers"))
|
||||||
|
subevent = models.ForeignKey(SubEvent, _("Connected sub-event"))
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = _('Shopping list')
|
||||||
|
verbose_name_plural = _('Shopping lists')
|
||||||
|
Loading…
Reference in New Issue
Block a user