Skip to content

Commit

Permalink
adjusted forms
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelnferreira committed Nov 22, 2013
1 parent 45f17f4 commit 1db4cea
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
19 changes: 13 additions & 6 deletions forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,26 @@
('Usuario','Usuario'),
)

PackageTypes = (
('Envelope [menos de 1kg]', 'Envelope [menos de 1kg]'),
('Pacote [ate 10 kg]', 'Pacote [ate 10 kg]'),
('Acima de 10 kg', 'Acima de 10 kg'),
)

class AppUserForm(djangoforms.ModelForm):
real_user = forms.EmailField(label='Usuario',widget=forms.TextInput(attrs={'size':'50','maxlength':'50'} ))
#name = forms.CharField(label='Identificacao',widget=forms.TextInput(attrs={'size':'50','maxlength':'50'} ))
vehicle = forms.TypedChoiceField(choices=Vehicles, initial='Moto')
user_type = forms.TypedChoiceField(choices=UserTypes, initial='Usuario')
name = forms.CharField(label='Nome',widget=forms.TextInput(attrs={'size':'50','maxlength':'50'} ))
real_user = forms.EmailField(label='E-mail',widget=forms.TextInput(attrs={'size':'50','maxlength':'50'} ))
phone = forms.CharField(label='Telefone',widget=forms.TextInput(attrs={'size':'50','maxlength':'50'} ))
#vehicle = forms.TypedChoiceField(choices=Vehicles, initial='Moto')
#user_type = forms.TypedChoiceField(choices=UserTypes, initial='Usuario')
class Meta:
model = AppUser
exclude = ['last_status', 'last_position', 'user_email']
exclude = ['last_status', 'last_position', 'user_email', 'last_lng', 'last_lat', 'avg_price', 'social_id', 'vehicle', 'user_type']

class DeliverFeeForm(djangoforms.ModelForm):
source_address = forms.CharField(label='Origem',widget=forms.TextInput(attrs={'size':'50','maxlength':'50'} ))
destination_address = forms.CharField(label='Destino',widget=forms.TextInput(attrs={'size':'50','maxlength':'50'} ))
item = forms.CharField(label='Item',widget=forms.Textarea)
item = forms.TypedChoiceField(choices=PackageTypes, initial='Envelope [menos de 1kg]')
class Meta:
model = DeliverFee
exclude = ['dest_lng','dest_lat', 'source_lat', 'source_lng','request_user', 'item', 'request_date_time', 'closed', 'state']
2 changes: 2 additions & 0 deletions models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class AppUser(db.Model):
last_lng = db.StringProperty()
avg_price = db.StringProperty()
social_id = db.StringProperty()
name = db.StringProperty()
phone = db.StringProperty()

class DeliverFee(db.Model):
source_address = db.StringProperty()
Expand Down

0 comments on commit 1db4cea

Please sign in to comment.