fundgoal: Add goal providers.
This commit is contained in:
parent
e952e2b26a
commit
621ace8488
3 changed files with 44 additions and 2 deletions
|
@ -1,7 +1,14 @@
|
|||
from django.contrib import admin
|
||||
from conservancy.apps.fundgoal.models import FundraisingGoal
|
||||
from conservancy.apps.fundgoal import models as fundgoal_models
|
||||
|
||||
class FundraisingGoalAdmin(admin.ModelAdmin):
|
||||
list_display = ('fundraiser_code_name', 'fundraiser_goal_amount')
|
||||
|
||||
admin.site.register(FundraisingGoal, FundraisingGoalAdmin)
|
||||
class GoalProviderAdmin(admin.ModelAdmin):
|
||||
fields = [
|
||||
'fundraising_goal',
|
||||
'provider_name',
|
||||
]
|
||||
|
||||
admin.site.register(fundgoal_models.FundraisingGoal, FundraisingGoalAdmin)
|
||||
admin.site.register(fundgoal_models.GoalProvider, GoalProviderAdmin)
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.7 on 2018-11-18 12:11
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('fundgoal', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='GoalProvider',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('provider_name', models.CharField(max_length=512)),
|
||||
('fundraising_goal', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='fundgoal.FundraisingGoal')),
|
||||
],
|
||||
),
|
||||
]
|
|
@ -18,3 +18,14 @@ class FundraisingGoal(models.Model):
|
|||
|
||||
class Meta:
|
||||
ordering = ('fundraiser_code_name',)
|
||||
|
||||
|
||||
class GoalProvider(models.Model):
|
||||
fundraising_goal = models.ForeignKey(
|
||||
'FundraisingGoal',
|
||||
on_delete=models.CASCADE,
|
||||
)
|
||||
provider_name = models.CharField(max_length=512)
|
||||
|
||||
def __unicode__(self):
|
||||
return self.provider_name
|
||||
|
|
Loading…
Reference in a new issue