# Path: kobra/db_fields.py
# class IdField(models.UUIDField):
#     def __init__(self, *args, **kwargs):
#         kwargs['primary_key'] = kwargs.get('primary_key', True)
#         kwargs['default'] = kwargs.get('default', uuid.uuid4)
#         kwargs['editable'] = kwargs.get('editable', False)
#         kwargs['verbose_name'] = kwargs.get('verbose_name', _('ID'))
#         super(IdField, self).__init__(*args, **kwargs)
# 
# class MoneyField(models.DecimalField):
#     def __init__(self, *args, **kwargs):
#         kwargs['max_digits'] = kwargs.get('max_digits', 12)
#         kwargs['decimal_places'] = 2
#         super(MoneyField, self).__init__(*args, **kwargs)
# 
# class NameField(StripValueMixin, models.CharField):
#     def __init__(self, *args, **kwargs):
#         kwargs['max_length'] = kwargs.get('max_length', 64)
#         kwargs['verbose_name'] = kwargs.get('verbose_name', _('name'))
#         super(NameField, self).__init__(*args, **kwargs)


import logging
import sesam
from django.conf import settings
from django.contrib.auth.models import (
    AbstractBaseUser,
    BaseUserManager,
    PermissionsMixin
)
from django.db import models
from django.utils.timezone import now
from django.utils.translation import ugettext_lazy as _
from .db_fields import IdField, MoneyField, NameField
    student.section = None

    return student


class Discount(models.Model):
    id = IdField()

    ticket_type = models.ForeignKey(
        'TicketType',
        related_name='discounts')
    union = models.ForeignKey(
        'Union',
        related_name='discounts')
    amount = MoneyField(
        default=0)

    class Meta:
        unique_together = [['ticket_type', 'union']]

        permissions = [
            ['view_discount', _('Can view discount')]
        ]

    def __str__(self):
        return '{} - {}: {} kr'.format(self.ticket_type, self.union,
                                       self.amount)


class DiscountRegistration(models.Model):

# Path: kobra/db_fields.py
# class IdField(models.UUIDField):
#     def __init__(self, *args, **kwargs):
#         kwargs['primary_key'] = kwargs.get('primary_key', True)
#         kwargs['default'] = kwargs.get('default', uuid.uuid4)
#         kwargs['editable'] = kwargs.get('editable', False)
#         kwargs['verbose_name'] = kwargs.get('verbose_name', _('ID'))
#         super(IdField, self).__init__(*args, **kwargs)
# 
# class MoneyField(models.DecimalField):
#     def __init__(self, *args, **kwargs):
#         kwargs['max_digits'] = kwargs.get('max_digits', 12)
#         kwargs['decimal_places'] = 2
#         super(MoneyField, self).__init__(*args, **kwargs)
# 
# class NameField(StripValueMixin, models.CharField):
#     def __init__(self, *args, **kwargs):
#         kwargs['max_length'] = kwargs.get('max_length', 64)
#         kwargs['verbose_name'] = kwargs.get('verbose_name', _('name'))
#         super(NameField, self).__init__(*args, **kwargs)


# Path: kobra/models.py
import logging
import sesam
from django.conf import settings
from django.contrib.auth.models import (
    AbstractBaseUser,
    BaseUserManager,
    PermissionsMixin
)
from django.db import models
from django.utils.timezone import now
from django.utils.translation import ugettext_lazy as _
from .db_fields import IdField, MoneyField, NameField

    student.section = None

    return student


class Discount(models.Model):
    id = IdField()

    ticket_type = models.ForeignKey(
        'TicketType',
        related_name='discounts')
    union = models.ForeignKey(
        'Union',
        related_name='discounts')
    amount = MoneyField(
        default=0)

    class Meta:
        unique_together = [['ticket_type', 'union']]

        permissions = [
            ['view_discount', _('Can view discount')]
        ]

    def __str__(self):
        return '{} - {}: {} kr'.format(self.ticket_type, self.union,
                                       self.amount)


class DiscountRegistration(models.Model):

    id = IdField()