silentsokolov / django-treasuremap Goto Github PK
View Code? Open in Web Editor NEWdjango-treasuremap app, makes it easy to store and display the location on the map using different providers (Google, Yandex).
License: MIT License
django-treasuremap app, makes it easy to store and display the location on the map using different providers (Google, Yandex).
License: MIT License
Hi, I'm new on Python/Django so I'm sorry if this is an obvious question.
I followed the install and configuration guide but the project raise this exception: ImportError: No module named 'treasuremap.backends'
I have no folder 'backends' after install treasuremap
How can I solve this???
If I add the folder 'backends' I get this error:
django.core.exceptions.ImproperlyConfigured: 'django.db.treasuremap_backends.postgresql_psycopg2' isn't an available database backend.
Try using 'django.db.backends.XXX', where XXX is one of:
'mysql', 'oracle', 'postgresql_psycopg2', 'sqlite3'
Error was: No module named 'django.db.treasuremap_backends'
I'm using:
Django 1.7
Python 3.4.2
PostgreSQL 0.9
Файлы:
https://github.com/silentsokolov/django-treasuremap/blob/master/treasuremap/backends/yandex.py
https://github.com/silentsokolov/django-treasuremap/blob/master/treasuremap/backends/google.py
Ошибка:
'module' object has no attribute 'urlencode'
Причина:
urllib has been split up in Python 3. The urllib.urlencode() function is now urllib.parse.urlencode(), and the urllib.urlopen() function is now urllib.request.urlopen()
https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlencode
Hi Sokolov;
How can I get latitude and longitude data separately from LatLongField in django model?
example my models:
from django.db import models
from treasuremap.fields import LatLongField
from django.contrib.auth.models import User
class ShopModel(models.Model):
name = models.CharField(max_length=100)
point = LatLongField(blank=True)
user = models.OneToOneField (User)
How should I query my database?something like this is possible;
latitude = ShopModel.objects.filter(user = request.user, point.latitude = mylatitude)
longitude = ShopModel.objects.filter(user = request.user, point.longitude = mylongitude)
I suppose that ADMIN_SIZE is missing in readme
Hello.
I found several typos in following files:
from treasuremap.widgets import AdminMapWidget
...
@admin.register(Post)
class PostAdmin(admin.ModelAdmin):
def formfield_for_dbfield(self, db_field, **kwargs):
if db_field.name == 'point':
kwargs['widget'] = widgets.AdminMapWidget()
Since we imported AdminMapWidget directly, the last line should be:
kwargs['widget'] = AdminMapWidget()
class YandexMapBackend(BaseMapBackend):
...
def get_api_js(self):
params = OrderedDict()
params["lang"] = settings.LANGUAGE_CODE
if self.API_KEY:
params["pikey"] = self.API_KEY
There is a typo in the name of the dictionary key.
The last line should be:
params["apikey"] = self.API_KEY
Thanks for the package. It was my first time working with Yandex maps and spatial data. Your package helped me a lot.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.