Hello, I'm new around here and I've been using SQLalchemy (SA) for a while. I work with PostGis (PG), OpenLayers (OL), ExtJS, GeoExtJS and now with the great SA and GeoAlchemy. I have one problem, I created a model where I defined one table of my PG database, it has a url like this: url = 'postgresql://postgres:password@localhost:5432/pgdb'. In my HTML, I have some maps displayed with OL and a toolbar built with ExtJS and GeoExtJS. I put a search button there using ExtJS, and the OL protocol code to get the data. This protocol has an url option, in this way:
var searchformPanel = new Ext.form.FormPanel(
{
width: 250,
bodyStyle: 'padding:5px',
labelAlign: 'top',
defaults:
{
anchor: '100%'
},
protocol: new OpenLayers.Protocol.HTTP(
{
url: 'http://localhost/mop/py/dbmodel.py',
format: new OpenLayers.Format.GeoJSON()
}
),
items:
etc,etc......
my problem is that in this url I wrote the whole path where my model script is located, but after pressing the button I got nothing. I think I need something else rather than only pointing the whole path and the python script in the url mentioned above, is that correct? I've searched "how to connect sqlalchemy to extjs" in google but didn't find any that solved this doubt.
Any support is very welcome, thanks in advance.
Best regards,
Gery
#created: 30 July 2012
#updated: 12 August 2012
#Gery
from sqlalchemy import *
from sqlachemy import create_engine, MetaData, Table
from sqlalchemy.orm import *
from sqlalchemy.orm import mapper, relation, backref, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
# Setup the url, database engine and session
url = 'postgresql://postgres:password@localhost:5432/mop'
engine = create_engine(url, echo=True)
session = sessionmaker(bind=engine)
session = Session()
# Setup the declarative extension and metadata
Base = declarative_base(metadata=metadata)
metadata = MetaData(engine)
# Define the model classes
class Boreholes(Base):
__tablename__ = 'boreholes_point_wgs84'
__table_args__ = {'autoload':True}
# DDL Extensions for geometry specific DDL
GeometryDDL(Boreholes.__table__)
--
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sqlalchemy/-/06H8WaCTV7cJ.
var store = new GeoExt.data.FeatureStore({ layer: sundials, proxy: new GeoExt.data.ProtocolProxy({ protocol: new OpenLayers.Protocol.HTTP({ url: "sundials.kml", format: new OpenLayers.Format.KML() }) }), fields: [ {name: 'title', type: 'string'}, {name: 'description', type: 'string'} ], autoLoad: true });