|
|
|
|
@ -78,7 +78,8 @@ def company_change(request, url): |
|
|
|
|
data['descriptions_%s' % code] = obj.descriptions |
|
|
|
|
# fill form |
|
|
|
|
form = CompanyForm(initial=data) |
|
|
|
|
form.fields['city'].widget.attrs['data-init-text'] = company.city.name |
|
|
|
|
if company.city: |
|
|
|
|
form.fields['city'].widget.attrs['data-init-text'] = company.city.name |
|
|
|
|
# set choices filled by ajax |
|
|
|
|
# form.fields['city'].choices = [(item.id, item.name) for item in City.objects.filter(country=data['country'])] |
|
|
|
|
form.fields['tag'].choices = [(item.id, item.name) for item in Tag.objects.filter(theme__in=data['theme'])] |
|
|
|
|
|