mirror of
https://github.com/fspc/workstand.git
synced 2026-09-16 16:41:38 -04:00
Initial commit.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
@@ -0,0 +1,5 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class CoreConfig(AppConfig):
|
||||
name = 'core'
|
||||
@@ -0,0 +1,35 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.9.4 on 2016-03-23 02:01
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Membership',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('modified_at', models.DateTimeField(auto_now=True)),
|
||||
('renewed_at', models.DateTimeField(default=django.utils.timezone.now)),
|
||||
('safe_space', models.BooleanField(default=False)),
|
||||
('community', models.BooleanField(default=False)),
|
||||
('space', models.BooleanField(default=False)),
|
||||
('give_back', models.BooleanField(default=False)),
|
||||
('acknowledgement', models.BooleanField(default=False)),
|
||||
('member', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='membership', to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,25 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.9.4 on 2016-03-23 02:27
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('core', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Payment',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('type', models.CharField(choices=[('CASH', 'cash'), ('CHEQUE', 'cheque'), ('VOLUNTEERING', 'volunteering'), ('STRIPE', 'stripe'), ('PAYPAL', 'paypal')], max_length=12)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('membership', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Membership')),
|
||||
],
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,27 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.9.4 on 2016-03-23 02:34
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('core', '0002_payment'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Visit',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('purpose', models.CharField(choices=[('VOLUNTEER', 'volunteer'), ('WORK', 'work on bike'), ('WORKSHOP', 'workshop')], max_length=50)),
|
||||
('member', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,49 @@
|
||||
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)
|
||||
member = models.OneToOneField(
|
||||
'registration.Member',
|
||||
on_delete=models.CASCADE,
|
||||
related_name='membership'
|
||||
)
|
||||
safe_space = models.BooleanField(default=False)
|
||||
community = models.BooleanField(default=False)
|
||||
space = models.BooleanField(default=False)
|
||||
give_back = models.BooleanField(default=False)
|
||||
# this should be a form field that requires the new member to type out there full name
|
||||
acknowledgement = models.BooleanField(default=False)
|
||||
|
||||
|
||||
class Payment(models.Model):
|
||||
membership = models.ForeignKey(
|
||||
'Membership',
|
||||
on_delete=models.CASCADE,
|
||||
)
|
||||
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'),
|
||||
('WORK', 'work on bike'),
|
||||
('WORKSHOP', 'workshop')
|
||||
)
|
||||
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)
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
Reference in New Issue
Block a user