Compare commits

..

3 Commits

3 changed files with 8 additions and 2 deletions

View File

@ -1,7 +1,10 @@
from django.contrib import admin from django.contrib import admin
from .models import Frequency, Band, Reference, QSO, User, Contest, ShadowCall, EntryCategory from .models import Frequency, Band, Reference, QSO, User, Contest, ShadowCall, EntryCategory
admin.site.register(User)
class UserAdmin(admin.ModelAdmin):
list_display = ('username', 'dncall', 'qrv2m', 'qrv70cm', 'extra2m70cm')
admin.site.register(User, UserAdmin)
admin.site.register(QSO) admin.site.register(QSO)
admin.site.register(Band) admin.site.register(Band)
admin.site.register(Frequency) admin.site.register(Frequency)

View File

@ -12,9 +12,10 @@ from .validators import CallUsernameValidator, CallLogValidator
class CustomUserCreationForm(UserCreationForm): class CustomUserCreationForm(UserCreationForm):
class Meta: class Meta:
model = User model = User
fields = ("username", "dncall", "qrv2m", "qrv70cm", "extra2m70cm") fields = ("username", "email", "dncall", "qrv2m", "qrv70cm", "extra2m70cm")
username = forms.CharField(max_length=50, validators=[CallUsernameValidator()]) username = forms.CharField(max_length=50, validators=[CallUsernameValidator()])
email = forms.EmailField(required=True)
class UpdateRefForm(forms.Form): class UpdateRefForm(forms.Form):
existingRef = forms.ModelChoiceField(label="Existing Exchange", queryset=Reference.objects.all(), help_text="If exchange already exists, select it here.", required=False) existingRef = forms.ModelChoiceField(label="Existing Exchange", queryset=Reference.objects.all(), help_text="If exchange already exists, select it here.", required=False)

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
Django==1.10
django-crispy-forms