Customizing Address field

29 views
Skip to first unread message

Nuruddin Iminohunov

unread,
Jun 1, 2016, 6:07:24 AM6/1/16
to django-oscar
I want to exclude some of address fields, how to remove not wanted fields? I set 
OSCAR_REQUIRED_ADDRESS_FIELDS = ('first_name', 'last_name', 'line1', 'city', 'postcode', 'phone_number') but when I submit phone number it requires region code

Sergey Maranchuk

unread,
Jun 1, 2016, 1:13:25 PM6/1/16
to django-oscar
Because default UserAddressForm inherited from PhoneNumberMixin
You can override
`clean_phone_number` method

https://github.com/django-oscar/django-oscar/blob/master/src/oscar/apps/address/forms.py#L23
https://github.com/django-oscar/django-oscar/blob/master/src/oscar/views/generic.py#L150

среда, 1 июня 2016 г., 13:07:24 UTC+3 пользователь Nuruddin Iminohunov написал:
Reply all
Reply to author
Forward
0 new messages