small fixes + migration
enable admin interface for bds
This commit is contained in:
parent
d46ab87e9b
commit
b5037329dd
4 changed files with 25 additions and 5 deletions
|
@ -1,3 +1,4 @@
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
from .models import BdsProfile
|
||||||
|
|
||||||
# Register your models here.
|
admin.site.register(BdsProfile)
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
import os.path
|
import os.path
|
||||||
from datetime import datetime
|
|
||||||
|
|
||||||
|
from django.utils import timezone
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
from gestion.models import Profile
|
from gestion.models import Profile
|
||||||
|
|
||||||
|
|
||||||
class BdsProfile(models.Model):
|
class BdsProfile(models.Model):
|
||||||
profile = models.OneToOneField(Profile,
|
profile = models.OneToOneField(Profile,
|
||||||
related_name='bds',
|
related_name='bds',
|
||||||
|
@ -12,8 +13,8 @@ class BdsProfile(models.Model):
|
||||||
|
|
||||||
def issue_file_name(sportif, filename):
|
def issue_file_name(sportif, filename):
|
||||||
fn, extension = os.path.splitext(filename)
|
fn, extension = os.path.splitext(filename)
|
||||||
year = str(datetime.now().year)
|
year = timezone.now().year
|
||||||
return "certifs/" + sportif.__str__() + '-' + year + extension
|
return "certifs/{!s}-{:d}{:s}".format(sportif, year, extension)
|
||||||
|
|
||||||
COTIZ_DURATION_CHOICES = (
|
COTIZ_DURATION_CHOICES = (
|
||||||
('ANN', 'Année'),
|
('ANN', 'Année'),
|
||||||
|
|
|
@ -222,7 +222,7 @@ class RegistrationCofProfileForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = CofProfile
|
model = CofProfile
|
||||||
fields = [
|
fields = [
|
||||||
"num", "type_cotiz", "is_cof", "is_buro",
|
"num", "type_cotiz", "is_buro",
|
||||||
"mailing", "mailing_bda", "mailing_bda_revente",
|
"mailing", "mailing_bda", "mailing_bda_revente",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
18
cof/migrations/0010_remove_cofprofile_is_cof.py
Normal file
18
cof/migrations/0010_remove_cofprofile_is_cof.py
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('cof', '0009_generic_profiles'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='cofprofile',
|
||||||
|
name='is_cof',
|
||||||
|
),
|
||||||
|
]
|
Loading…
Reference in a new issue