Git Product home page Git Product logo

Comments (4)

arbeiterz avatar arbeiterz commented on July 19, 2024

I ran into a similar issue and spent two days trying to resolve it. I finally resolved it and I believe the ultimate cause of my particular issue was that I wasn't loading the static files in my own application correctly. The static files in the django-address application were being loaded just fine when the {{forms.media}} template tag was encountered but the actual javascript libraries in my own project (geocomplete, query) weren't being loaded correctly. After executing 'runserver', hit it with a web browser and make sure that these static components are being loaded correctly.

EDIT: I initially thought that the problem was due to the fact that I was using ModelForms but it appears to work just fine with ModelForms.

Of course, I realize my response is over a year old since you posted your question but others might benefit from 16+ hours blown trying to troubleshoot this issue.

from django-address.

bansalnvn avatar bansalnvn commented on July 19, 2024

Hi, When I am trying to use {{ form.address }} in my view template file. It is generating the hidden text fields for all the address attributes.


<input type="text" name="address" class="address" placeholder="None" required id="id_address">
--
  | <div id="address_components">
  | <input type="hidden" name="address_country" data-geo="country" value="" />
  | <input type="hidden" name="address_country_code" data-geo="country_short" value="" />
  | <input type="hidden" name="address_locality" data-geo="locality" value="" />
  | <input type="hidden" name="address_sublocality" data-geo="sublocality" value="" />
  | <input type="hidden" name="address_postal_code" data-geo="postal_code" value="" />
  | <input type="hidden" name="address_route" data-geo="route" value="" />
  | <input type="hidden" name="address_street_number" data-geo="street_number" value="" />
  | <input type="hidden" name="address_state" data-geo="administrative_area_level_1" value="" />
  | <input type="hidden" name="address_state_code" data-geo="administrative_area_level_1_short" value="" />
  | <input type="hidden" name="address_formatted" data-geo="formatted_address" value="" />
  | <input type="hidden" name="address_latitude" data-geo="lat" value="" />
  | <input type="hidden" name="address_longitude" data-geo="lng" value="" />
  | </div>

Is it how it is supposed to work ?

from django-address.

gouravsinha05 avatar gouravsinha05 commented on July 19, 2024

Hey Thanks
Really helped me, small change there is a issue (maybe because of latest version )

class MemberForm(forms.ModelForm):
class Meta:
model = Member
address = AddressField
fields = ('address', 'birth_date', 'bio', 'active', 'other_details' )
is now

class MemberForm(forms.ModelForm):
class Meta:
model = Member
address = AddressField
fields = ['address', 'birth_date', 'bio', 'active', 'other_details' ]

from django-address.

banagale avatar banagale commented on July 19, 2024

Closing as a duplicate of #92.

from django-address.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.