I'm trying to edit address form for Saleor ecommerce platform

75 views
Skip to first unread message

ruslan.aldar

unread,
Apr 7, 2018, 2:09:22 PM4/7/18
to Django users
hello. 
I'm trying to build an local merchant website. So I don't know how to edit address form for Saleor. It uses google i18n address form. 
and when i'm trying to delete some fields like company_name, city city_area, postal_code, country, country_area, i'm having problem.


i'm getting 
{% with address_form_lines=address_form.i18n_fields_order %}
this kind of error. 

Making migration doesn't solve the problem and I don't know why it's requesting the field which is doesn't exist!  I even tried deleting DB, migrating again!

If someone knows it please tell me. 
Thank you.

Avraham Serour

unread,
Apr 8, 2018, 8:38:14 AM4/8/18
to django-users
You seem to have pasted a line from your template, not the error you are getting, no way of helping you there.

Please post the actual error you are getting

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5f44cebc-915e-4c08-b394-13efc4ca5c0c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ruslan.aldar

unread,
Apr 13, 2018, 6:10:31 AM4/13/18
to Django users
Hello thank you for your reply.
the problem is when I'm removing fields like company_name, city, city_area, postal code from account/models.py , i18n.py. 

Mostly this error appears when I delete one line in I18N_MAPPING.

on the web:

KeyError at /checkout/shipping-address/

'company_name'
Request Method:GET
Request URL:http://localhost:8000/checkout/shipping-address/
Django Version:2.0.3
Exception Type:KeyError
Exception Value:
'company_name'
Exception Location:C:\Users\rusla\Documents\GitHub\zahial\saleor\saleor\account\i18n.py in _convert_to_bound_fields, line 199

Error during template rendering

In template C:\Users\rusla\Documents\GitHub\zahial\saleor\templates\account\snippets\address_form.html, error at line 3

company_name

1{% load bootstrap_field from bootstrap4 %}
2<div class="i18n-address">
3 {% with address_form_lines=address_form.i18n_fields_order %}
I deleted commented out every company name in my source code. But I still having same issue.
I guess i18naddress requires those fields by default. 


On Sunday, April 8, 2018 at 8:38:14 PM UTC+8, Avraham Serour wrote:
You seem to have pasted a line from your template, not the error you are getting, no way of helping you there.

Please post the actual error you are getting
On Sat, Apr 7, 2018 at 2:00 PM, ruslan.aldar <ruslan...@gmail.com> wrote:
hello. 
I'm trying to build an local merchant website. So I don't know how to edit address form for Saleor. It uses google i18n address form. 
and when i'm trying to delete some fields like company_name, city city_area, postal_code, country, country_area, i'm having problem.


i'm getting 
{% with address_form_lines=address_form.i18n_fields_order %}
this kind of error. 

Making migration, or deleting db, doesn't solve the problem and I don't know why it's still requesting the field which is doesn't exist!  I even tried deleting DB, migrating again!
 

If someone knows it please tell me. 
Thank you.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

Samuel Muiruri

unread,
Apr 14, 2018, 10:12:12 AM4/14/18
to Django users
"adress_form_lines" you need to follow it to where you get the data from then follow that to wherever the model is, maybe it's instanced somewhere inside the model like

class Model(models.Model):
    ...

    def __str__(self):
           return self.company_name

anyway likely it's noted where in the code it crashed later on down the line of the error
Reply all
Reply to author
Forward
0 new messages