Re: How to change path to static files (./public/) dynamically

2007-12-13 Thread [EMAIL PROTECTED]

Aha, thank you, Ches. It's similar to what I want but the problem is
that the quantity of different static_files paths I need is thousands,
so with this mean I have to generate thousands of apps, yep?

On Dec 13, 7:49 am, Ches Martin [EMAIL PROTECTED] wrote:
 Hi.

 Not exactly per-request with __before__(), but the solution here may
 work for you or set you on track to working it out:http://tinyurl.com/2kg9cz

 --
 Ches Martin


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: How to change path to static files (./public/) dynamically

2007-12-13 Thread Matt Feifarek
On Dec 13, 2007 10:28 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 ...And evidently I get new problem: how to access session from  that
 CustomURLParser.__call__() method defined in middleware?


I think you're better off with a custom controller superclass than
middleware; then you can have access to all the stuff you're used to from a
controller, including session, c, g, h, etc.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: How to change path to static files (./public/) dynamically

2007-12-13 Thread [EMAIL PROTECTED]

...And evidently I get new problem: how to access session from  that
CustomURLParser.__call__() method defined in middleware?

I have:
if not vars().has_key('model'):
import myproject.model as model
if not vars().has_key('session'):
from pylons import session

Works perfectly for model but not for session: 'TypeError: No object
(name: Session) has been registered for this thread'.
I'm playing with SessionMiddleware but with no result.

On Dec 13, 5:54 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 The problem solved by custom StaticURLParser's child with __call__()
 method overrided in middleware. Thanks, Matt and Ches!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Upgrading existing project to newer Pylons

2007-12-13 Thread Christoph Haas

On Thu, Dec 13, 2007 at 11:47:58AM +0100, Marcin Kasperski wrote:
 Maybe I missed something, but 
 
 ... what should I do to upgrade existing project to the new
 Pylons release? I mean, for example, patching middleware.py so
 it suits newer idioms, patching imports etc.

Install the new Pylons version. Then pretend you are creating
(overwriting) a brand new Pylons project. Go into the parent directory
of where your development.init is located and run something like:

$ paster create -t pylons myapplication

Paster will then show you diffs of what has changed so you have a chance
to include the changes without breaking your stuff.

 I considered forcing some 3-way merge (old 'post-paster-create'
 version, current 'post-paster-create' version and the actual project),
 but it seems a bit tedious to setup. Maybe there is some simpler way?

This is. Although I'd prefer if I could launch vimdiff or kompare during
the upgrade. It's pretty good that it exists already anyway. It does no
3-way-diff/merge though. So if you changed something in the files then
the paster create upgrade will suggest to throw away your changes
unless you carefully include them. :(

Cheers
 Christoph


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: How to change path to static files (./public/) dynamically

2007-12-13 Thread [EMAIL PROTECTED]

You're right, but this causes new questions: how to solve problems
with large files, caching etc?

On Dec 13, 6:38 pm, Matt Feifarek [EMAIL PROTECTED] wrote:

 I think you're better off with a custom controller superclass than
 middleware; then you can have access to all the stuff you're used to from a
 controller, including session, c, g, h, etc.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



apache/fcgi deployment question

2007-12-13 Thread Pete Taylor

Hi all...  I've searched through the pylons discuss archives, and am
still a bit stuck.

I've read through the deployment guide for
pylons/apache/fcgi/mod_rewrite at pylonshq, as well as most of the
documents linked from it in reference.  I'm pretty used to deploying
rails
applications in similar ways, so most of it was familiar...  But I've
run into a snag that I'm hoping you might be able to help me pin down.
 I saw a few references to what seems to be a similar issue on the
lists.  Since the pylonshq guide to deployment seems to be out of date
as of .8, it may just be something I'm missing?

I'm using flup, and the application works, other than some
unfortunately hard-coded absolute paths to images, behind
dispatch.fcgi.  However, when I put in the override for SCRIPT_NAME =
'' in config.environ, and make my .htaccess rewrite rules match those
on the write up (which are pretty close to the ones rails uses as
well), I sit in an infinite (up to 10, of course, at which point
apache kills it anyway) redirection loop, where dispatch.fcgi keeps
getting post-pended to the redirect url, making it look like
/dispatch.fcgi/dispatch.fcgi/ (etc) in the rewrite.log.

My current rewrite rules look like this:

RewriteEngine On
RewriteRule   ^$  /dispatch.fcgi/
RewriteRule   ^(\[-_a-zA-Z0-9/\.]+)$  /dispatch.fcgi/$1

I've tried a number of permutations of the modifications to
lib/base.py as described in the Fixing Broken Routes part of the
document (overriding SCRIPT_NAME in config.environ), but I can't seem
to make it play nicely with mod_rewrite.

I'm using Pylons 0.9.5, apache2.2, on ubuntu.  Any help would be great.  Thanks!

Pete

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: moin moin integration, please help

2007-12-13 Thread Max

Sorry for the delay, but I also need the name of your project.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: tg catwalk, django admin, simple crud like app?

2007-12-13 Thread Mark Ramm

 DbMechanic aims to totally replace and exceed Catwalk. Chris posted a
 fair wack about it recently on the TG trunk list if you're interested.

The catwalk implementation was pretty difficult to extend and
maintain.   But dbsprockets seems likely to be much easier to
maintain/extend once it gets done.   And it should be reasonably easy
to use it with plain pylons eventually.  The current focus is on
completing back-end features, and making everything work with one DB
backend (SQLAlchemy) and one web frontend (TG2+ToscaWidgets).   But
from what I've seen it's being designed to support alternate backends,
and pylons+toscawidgets should be relitively simple to integrate as a
front end.

--Mark Ramm

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: How to change path to static files (./public/) dynamically

2007-12-13 Thread Ian Bicking

Konstantin Alexandrov wrote:
 Hello.
 Is this possible with Pylons to change static files path in 
 BaseController's __before__() method each time on request?

I haven't followed any of this, but I thought I'd mention that you can do:

def action(self):
 file_path = (calculate)
 app = paste.fileapp.FileApp(file_path)
 return app(self.environ, self.start_response)

At least, I think that's how you dispatch to a WSGI application in an 
action?  Anyway, you still get ranges, conditional responses, etc.

-- 
Ian Bicking : [EMAIL PROTECTED] : http://blog.ianbicking.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Bug in Mapper.generate?

2007-12-13 Thread Utku

Hi,

The generate method prefers to use the route which has the least
uncommon variables in it, but if route is not an exact match then a
route with most common variables must be selected I suppose. The
comment says the same thing but the code does the one I mentioned
above.

Here is what I mean
self.mapper.connect('query', '/Property/
query/:pclass/:status/:city/:town/:district',
controller = 'Property', action=query,
pclass=False,
city=None, town=None, district=None,
status=all)
self.mapper.connect(':controller/:action/:id',
controller=Main)
print self.mapper.generate(controller=Property,
action=query, pclass=business)
---:
outputs: /Property/query?pclass=business

Index: base.py
===
--- base.py (revision 376)
+++ base.py (working copy)
@@ -919,7 +919,7 @@
 # Neither matches exactly, return the one with the
most in
 # common
 if cmp(lendiffa, lendiffb) != 0:
-return cmp(lendiffa, lendiffb)
+   return cmp(len(keysb), len(keysa))

 # Neither matches exactly, but if they both have just
as much
 # in common

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Routes map.resource and Non Alpha Chars

2007-12-13 Thread [EMAIL PROTECTED]

I hit up Ben Bangert with this briefly on IRC:

I am using map.resource in the manner suggested by the docs. However,
it blows up whenever the id has a encoded space in it.

So, when /resource/id looks like /locations/Tulsa%20OK it fails.

Ben suggested this is an issue with the default regexp used for
resource
routes. It looks like I can circumvent this by manually entering the
routes
instead of calling map.resource('location', 'locations').

Do I lose anything by doing this? Or, should I be handling the
encoding
of the space in Tulsa OK differently?



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: tg catwalk, django admin, simple crud like app?

2007-12-13 Thread Ches Martin

On Dec 4, 2:39 pm, Rick Flosi [EMAIL PROTECTED] wrote:
 AdminPylon
 http://adminpylon.devjavu.com/

Anyone made any contact with this person? The new code real soon now
message has been up for quite some time. I sent an email awhile ago
asking if he/she could just put up what's done as a branch to play
with if some progress had been made over what's there now. Didn't get
any response.

The pace of work on dbsprockets/DbMechanic looks pretty impressive,
but AdminPylon is very small and simple, which would be nice to have
as an option...

--
Ches Martin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---