Only comments associated with the current page should be listed, so once again the query is modified to include the page ID. In this case, though, we also have to pass the pageid argument, which will in turn get passed to any h.url_for() calls in the paginator.
from http://pylonsbook.com/en/1.1/simplesite-tutorial-part-2.html
i can...
Is there a one and true way to add authentication in Pylons? I've seen so many different ways, but most of them are either outdated or too complex. Is there a tutorial somewhere that explains how to add authentication in a good and solid way?
...
Hi!
I just start lern python, pylons.
i have problem with setting up datebase connection.
i won't to set connection, where i can see this connection in all my controllers.
Now i use: some thing like this in my controller:
45 ' db = create_engine('mysql://root:password@localhost/python')
46 ' metadata = MetaData(db)
47
48 ' ...
how do i setup authkit for more authorizer? i want to give certain users admin rights, but only for their own page. thanks
...
Hi!
I try to get all row from table.
in controler i try to
meta.Session.query(User).all()
But the result is [, ]
In this table i heve 2 rows.
I get this model for the table:
import hashlib
import sqlalchemy as sa
from sqlalchemy import orm
from allsun.model import meta
t_user = sa.Table("users",meta.metadata,autoload=True)
...
what is the current state of user authentication? is it good to go with openid or another alternative, or we still have to write our own user/password?
...
What is the best way to create a unique user ID in Python, using UUID?
...
Firstly, I should say I'm completely new to Pylons, trying to learn web development with Python after coming from a PHP/MySQL background. I've seen similar questions to this problem, but mine is kind of a reverse version.
I've been following the Pylons book (pylonsbook.com) to setup my application and get the following error:
ImportErr...
I'm using Pylons and want to add some middleware to it so that it catches 401 status codes and makes HTTP Redirect (302) to Signin page.
I know there is built-in StatusCodeRedirect in Pylons that acts in a similar fashion, but it does not produce HTTP redirect, and rather redirects internally (this is what I do not want).
Is there any ...
in mako template, i use this
${request.environ['repoze.who.identity']['user']}
and the render in controller:
render('file.html')
can i write this better without passing in parameter everytime?
...
im using FriendlyFormPlugin, but would like to retrieve the username that was input as part of the request.params, but its no longer there when i check. this way i can set the default for username if the password is incorrect. thanks
...
Currently my login controller doesn't work because i can't seem to fetch the username and password.
I'm currently using something like this:
form_username = str(request.params.get('username'))
db_user = meta.Session.query(User).filter_by(username=form_username)
if db_user is None:
return redirect('auth/error')
No matter which us...
Hi,
reading pylons documentations I did understand that websetup:setup_app is only called when the application is setup at first time by paster script. But, I found now, setup_app is call every time that application starts. Debugging the code, this behaviour seems right beacuse in appinstall.setup_config the module is loaded (as PRJ.web...
how do i do enumeration in sqlachemy? im using pylons if it matters. i also want to have in code to create different object depends on the enumeration, with the same parameters, but different object class.
...
I have a Pylons project and a SQLAlchemy model that implements schema qualified tables:
class Hockey(Base):
__tablename__ = "hockey"
__table_args__ = {'schema':'winter'}
hockey_id = sa.Column(sa.types.Integer, sa.Sequence('score_id_seq', optional=True), primary_key=True)
baseball_id = sa.Column(sa.types.Integer, sa.Forei...
how do i import classes from a pylons project for maintenance scripts?
...
I'd like to implement PyFacebook in my Python + Pylons application. Where should I include the package? What's the cleanest way to import it? What directory should I put the files in? Thanks!
...
I'd like to offer a news-feed like feature for users of our website. When the user logs in, he is shown a list of the latest updates across various areas of the site.
I'm afraid that this is going to be difficult to scale.
What are some networking / database topologies that can support a scalable infrastructure without having lots o...
How do I change the regular 404 page generated by Pylons to my own custom-made 404 page?
Thanks in advance,
John
...
I'm working on an application using Pylons and I was wondering if there was a way to make sure it doesn't spend way too much time handling one request. That is, I would like to find a way to put a timer on each request such that when too much time elapses, the request just stops (and possibly returns some kind of error).
The applicatio...