Added a ModelForm to change profile details.
This commit is contained in:
parent
3855fb28d7
commit
53f89caef5
@ -8,7 +8,7 @@ from django.db import models
|
|||||||
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
|
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
from lostplaces.models import Place, PlaceImage, Voucher
|
from lostplaces.models import Place, PlaceImage, Voucher, Explorer
|
||||||
|
|
||||||
class SignupVoucherForm(UserCreationForm):
|
class SignupVoucherForm(UserCreationForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
@ -35,6 +35,12 @@ class SignupVoucherForm(UserCreationForm):
|
|||||||
fetched_voucher.delete()
|
fetched_voucher.delete()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
class ProfileChangeForm(forms.ModelForm):
|
||||||
|
class Meta:
|
||||||
|
model = Explorer
|
||||||
|
fields = '__all__'
|
||||||
|
exclude = ['user', 'favorite_places']
|
||||||
|
|
||||||
class PlaceForm(forms.ModelForm):
|
class PlaceForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Place
|
model = Place
|
||||||
|
Loading…
Reference in New Issue
Block a user