Closed imincik closed 13 years ago
Commited some code addressing this issue. Created two tables in PostGIS model (JosArticleId, JosPhotoId) to storing id numbers (ManyToMany relation is useless because of: https://docs.djangoproject.com/en/1.3/topics/db/multi-db/#cross-database-relations)
Sample code from shell:
from mapdata.models import Poi, JosPhotoId, JosArticleId, Area import datetime from josdata.models import JosJoomgallery, JosContent from django.contrib.gis.geos import Point a1 = Area(name = 'Nizke Tatry') a1.save()
p1 = Poi(name = 'p1', area = a1, type = 1, created_by = 'Matus Valo', created_at = datetime.date.today(), active = True, point = Point(30,20)) p1.save()
aid = JosArticleId(JosContent.objects.all()[0].id) aid.save() pid = JosPhotoId(JosJoomgallery.objects.all()[0].id) pid.save()
p1.jos_article_id.add(aid) p1.jos_photo_id.add(pid) p1.save()
Demonstrate connection of models POI (PostGIS) and model containg photo gallery in Joomla (jos_joomgallery)