mirror of https://github.com/fspc/workstand.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.4 KiB
47 lines
1.4 KiB
from django.db import models
|
|
from django.utils import timezone
|
|
|
|
|
|
class Membership(models.Model):
|
|
created_at = models.DateTimeField(auto_now_add=True)
|
|
modified_at = models.DateTimeField(auto_now=True)
|
|
renewed_at = models.DateTimeField(default=timezone.now)
|
|
self_identification = models.CharField(max_length=255, null=True, blank=True)
|
|
gender = models.CharField(max_length=255, null=True, blank=True)
|
|
involvement = models.CharField(max_length=255, null=True, blank=True)
|
|
payment = models.ForeignKey(
|
|
'Payment',
|
|
on_delete=models.CASCADE,
|
|
blank=False,
|
|
null=True
|
|
)
|
|
|
|
|
|
class Payment(models.Model):
|
|
payment_choices = (
|
|
('CASH', 'cash'),
|
|
('CHEQUE', 'cheque'),
|
|
('VOLUNTEERING', 'volunteering'),
|
|
('STRIPE', 'stripe'),
|
|
('PAYPAL', 'paypal')
|
|
)
|
|
type = models.CharField(max_length=12, choices=payment_choices)
|
|
created_at = models.DateTimeField(auto_now_add=True)
|
|
|
|
|
|
class Visit(models.Model):
|
|
visit_choices = (
|
|
('VOLUNTEER', 'volunteer'),
|
|
('FIX', 'fix bike'), # fix
|
|
('WORKSHOP', 'workshop'),
|
|
('VISIT', 'visit'),
|
|
('DONATE', 'donate'),
|
|
('STAFF', 'staff'),
|
|
)
|
|
|
|
member = models.ForeignKey(
|
|
'registration.Member',
|
|
on_delete=models.CASCADE
|
|
)
|
|
created_at = models.DateTimeField(auto_now_add=True)
|
|
purpose = models.CharField(max_length=50, choices=visit_choices)
|
|
|