lostplaces-backend/lostplaces/lostplaces_app/forms.py

21 lines
518 B
Python
Raw Normal View History

from django import forms
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from .models import Explorer, Place
class ExplorerCreationForm(UserCreationForm):
class Meta:
model = Explorer
fields = ('username', 'email')
class ExplorerChangeForm(UserChangeForm):
class Meta:
model = Explorer
fields = ('username', 'email')
class PlaceForm(forms.ModelForm):
class Meta:
model = Place
fields = '__all__'
exclude = ['submitted_by']