Closed MaxDragonheart closed 5 years ago
I will look on it, when I end my deadline project
Hello @MaxDragonheart I have also had this issue and its actually a bug. Edit line 6 of this file: mapbox_location_field/widgets.py and change it to:
def parse_tuple_string(tuple_string): return tuple(map(float, tuple_string[1:-1].split(",")))
That fixes it. I think i should send in a PR
@Simon-the-Shark I have opened a PR that resolves the problem. https://github.com/Simon-the-Shark/django-mapbox-location-field/pull/7
Thanks @aitoehigie :)
Now, as long as @Simon-the-Shark doesn't solve the bug I cant use the packcage? Now I've no problem on my project but it is in local and not yet online. What do you suggest @aitoehigie ?
You can clone it, effect the change to your own copy of the clone. So whenever you want to use the library you can pip install git+[URL to you own repo] Till he merges the PR containing the fix into the main branch.
Does that make sense?
On Mon, 28 Oct 2019, 09:59 Massimiliano Moraca, notifications@github.com wrote:
Now, as long as @Simon-the-Shark https://github.com/Simon-the-Shark doesn't solve the bug I cant use the packcage? Now I've no problem on my project but it is in local and not yet online. What do you suggest @aitoehigie https://github.com/aitoehigie ?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Simon-the-Shark/django-mapbox-location-field/issues/5?email_source=notifications&email_token=AABPDWCG5FCI6D7Q6PN7IR3QQ2SXPA5CNFSM4JASESNKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECME4IA#issuecomment-546852384, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABPDWD4MCC7J4O2AEM6BPDQQ2SXPANCNFSM4JASESNA .
I think that yours is a good method. I'm not an expert, it's the first time for me to use my personal repository with Django but I can try :)
Let me know if it works for you.
On Mon, Oct 28, 2019 at 7:23 PM Massimiliano Moraca < notifications@github.com> wrote:
I think that yours is a good method. I'm not an expert, it's the first time for me to use my personal repository with Django but I can try :)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Simon-the-Shark/django-mapbox-location-field/issues/5?email_source=notifications&email_token=AABPDWC555RCHUK3CVCJ6U3QQ4UYJA5CNFSM4JASESNKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECN45MQ#issuecomment-547081906, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABPDWGASXFUPNAFS26PEWTQQ4UYJANCNFSM4JASESNA .
Hi! Sorry for late response. I was assuming that right format of entering center point was with space after comma. But @aitoehigie version is better because it accepts both format (with space and spaceless) and that's why it is in the newest version 0.2.7. You can update it with pip even now.
Thank you :)
Here I describe my problem. Maybe it is a bug?
This is the traceback: Environment:
Request Method: POST Request URL: http://127.0.0.1:8000/geomonitor/add/illegal-dump-map/
Django Version: 2.2.5 Python Version: 3.6.8 Installed Applications: ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.sites', 'django.contrib.sitemaps', 'django.contrib.flatpages', 'django.contrib.gis', 'blog', 'geomodels', 'geosources', 'kernel', 'sitemapgenerator', 'usermanager', 'django_summernote', 'mapbox_location_field'] Installed Middleware: ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware']
Template error: In template /home/max/Django/gealogos/gealogos_dev/gealogos/geosources/templates/geosources/base_map.html, error at line 0 could not convert string to float: '6.01245266838146,-10.16992187499897' 1 : {% load static %} 2 : <!doctype html> 3 : 4 :
5 : {% include 'google.html' %} 6 : 7 : 8 : 9 :Traceback:
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
File "/home/max/Django/gealogos/gealogos_dev/gealogos/geomodels/views.py" in add_illegal_dump
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/django/shortcuts.py" in render
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/django/template/loader.py" in render_to_string
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/django/template/backends/django.py" in render
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/django/template/base.py" in render
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/django/template/base.py" in _render
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/django/template/base.py" in render
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/django/template/base.py" in render_annotated
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/django/template/loader_tags.py" in render
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/django/template/base.py" in _render
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/django/template/base.py" in render
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/django/template/base.py" in render_annotated
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/django/template/loader_tags.py" in render
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/django/template/base.py" in render
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/django/template/base.py" in render_annotated
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/django/template/base.py" in render
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/django/template/base.py" in resolve
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/django/template/base.py" in resolve
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/django/template/base.py" in _resolve_lookup
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/django/forms/forms.py" in as_p
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/django/forms/forms.py" in _html_output
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/django/utils/html.py" in
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/django/forms/boundfield.py" in str
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/django/forms/boundfield.py" in as_widget
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/mapbox_location_field/widgets.py" in render
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/mapbox_location_field/widgets.py" in get_config_settings
File "/home/max/Django/gealogos/devenv/lib/python3.6/site-packages/mapbox_location_field/widgets.py" in parse_tuple_string
Exception Type: ValueError at /geomonitor/add/illegal-dump-map/ Exception Value: could not convert string to float: '6.01245266838146,-10.16992187499897'