Thanks for all the helps
:)
On Monday, March 31, 2014 8:11:20 PM UTC+11, Chung WONG wrote:
For example, there is a view returns a http exception to a request:
@view_config(route_name='route', renderer='json', request_method='GET')
def view(request):
*return
Newbie to Pylons (in fact, fairly new to Python). Lots of programming
experiences in Java, C++ and Objective-C though.
Still learning Pylons and I found the wiki tutorial is excellent. However,
there are a few areas that I am interested:
1. the wiki tutorial is a bit light on authentication and
Hello, everyone, I am starting to use sqlalchemy now and really got
frustrated in understanding the purpose of relationship().
For example, if I make a model with a foreign key like the one in
sqlalchemy's official docs:
class Parent(Base):
__tablename__ = 'parent'
id =
I want to serve images via file:/// scheme as all clients in an internal
network mount the same image filer.
A test:
A simple html file on disk correctly loads and renders an image via a
file:/// URI:
img src=file:///tmp/test.png/img
..the equivalent html served from pyramid/wsgi does not:
Here is a rewrite of the tutorial which goes into more depth,
section-by-section:
http://docs.pylonsproject.org/projects/pyramid/en/master/quick_tutorial/index.html
It has a little more on authentication and authorization and is aimed at
Jinja2. It might still be too light for your needs.
Browser security prevents loading local files referenced from network
loaded
html pages. Mixing file:// and http:// protocols won't work.
img src=file:///tmp/test.png/img
--
Arndt Droullier, Nive GmbH, Köln, Germany, www.nive.co
--
You received this message because you are subscribed to the
I created a tutorial (a schedule), uses a bit of SQLAlchemy, some comments
are on en, but Python is universal:)
SqlAlchemy + Jinja2
https://github.com/GruPy-RN/agenda_pyramid
Mário Idival
*Twitter *: *@marioigd*
*Facebook*: *mario.idival*
*User Linux : **#554446*
Skype*: marioidival*
Hi,
you should write to sqlalchemy's mailing list :
http://www.sqlalchemy.org/support.html#mailinglist
You'll find a definition of foreign keys here (it's an sql functionnality):
http://docs.sqlalchemy.org/en/rel_0_9/core/constraints.html#defining-foreign-keys
For the relationship function,
On Tuesday, April 1, 2014 2:46:06 AM UTC-7, Chung WONG wrote:
For example:
*DBSession =
scoped_session(sessionmaker(extension=ZopeTransactionExtension()))*
*class User(Base):*
*id = Column(Integer,Sequence('user_id_seq'), primary_key=True)*
*username = Column(Unicode(255),
Assuming this is SqlAlchemy, your only option is to call flush().
`flush()` simply tells the session to talk to the database.
if you don't call `flush()` or `commit()`, SqlAlchemy doesn't talk to the
database, and has no way of obtaining an id.
i think requiring an explicit command to talk to
*def some_view(request):*
*some_code(sqlalchemy_related)*
*return s http://user.id/ome_response*
if the above execution of view doesn't trigger any error, the transaction
is auto committed with scoped session.
In case of having an error, the transaction aborted. I guess the view
If you are using the ZopeTransactionExtension combined with pyramid_tm then
the view is irrelevant. pyramid_tm is a tween that wraps everything that
happens while processing a request (for the purposes of this discussion).
You should be clear up front that the DBSession is wrapping a database
12 matches
Mail list logo