hi,
Im trying to get data in pylon to use in jquery autocomplete,
the librarary i'm using for autocomplete it requires this format
abc
pqr
xyz
and in python i have data in this format
[["abc"], ["pqr"],["xyz"]
How do i convert this list to the above one.
Edit:
I trying to use these for a autocompete and i'm using pylons, in ...
I'm at a point in my Pylons projects where I end up creating and deleting controllers often (probably more often than I should). I grow tired of adding my own imports and tweaks to the top of every controller. There was a recent question about modifying the new controller template that got me part-way to not having to do that - but I do...
I tried to install Pylons 1.0 with Python 2.7 using the easy_install command in Windows Vista 64 but got the error:
raise ValueError(str(list(result.keys())))
ValueError: [u'path']
Here is the link to the whole installation process from command prompt
http://pastie.org/1190341
Why do I get this error?
How do I solve it?
Will P...
When I try to import pylons in the virtual python environment I get the error
C:\env\Scripts>python
Python 2.7 (r27:82525, Jul 4 2010, 07:43:08) [MSC v.1500 64 bit (A
MD64)] on win32
Type "help", "copyright", "credits" or "license" for more informati
on.
>>> import pylons
Traceback (most recent call last):
File "<stdin>", line 1, in ...
I've got a pylons setup, using flup with nginx, and url.current() always returns totally wrong.
I have a route:
map.connect('testpage', '/test', controller='Main', action='test')
And in that controller, I do url.current() and I get /test/test' instead of '/test'. I've tried changingSCRIPT_NAME` as various posts about using uwsgi sug...
I am trying to activate my Virtual Python Environment to use with Pylons but I think I am executing the commands wrong.
jem@jem-laptop:~$ source env/bin/activate
bash: env/bin/activate: No such file or directory
What am I doing wrong?
How should I do it right?
...
I am very puzzled over this error. In a previously functional Pylons app (running on apache/mod_wsgi), Routes has exploded. When I attempt to access my application, no matter what URL I use, I get the Apache "Internal server error" page and the following traceback in /var/log/apache2/error.log.
[Sat Oct 02 2010] WSGI Variables
[Sat ...
I have an action which looks like this:
class ArticleController(BaseController):
def all(self, page, pagesize):
I want to be able to access /article/all/{page}/{pagesize}, with default values for page and pagesize.
I tried setting the default values in the action method, but then apparently both page and pagesize get set to the d...
How can I access my request.params post data from my Mako template with Pylons?
...
Hi guys, I'm using Mako + Pylons and I've noticed a horrendous amount of whitespace in my HTML output.
How would I go about getting rid of it? Reddit manage to do it.
...
Hi.
What's the best way to handle form POST data in my Pylons app? I've tried:
Having a seperate GET method and a POST method with a rest.restrict('post') decorator. Problem -- if there were validation errors then you can't redisplay the form with the data which the user entered because you have to redirect back to the GET method OR y...
I'm a php programmer who's just getting started with Python. I'm trying to get Python to handle login/logout via database-stored sessions. Things work, but seem inconsistent. For example, sometimes a user isn't logged out. Sometimes users "switch" logins. I'm guessing this has something to do with thread-safety, but I'm just not sur...
How can I copy a posted file to disk?
Can I do something like:
file = '/uploaded_files/test.txt'
shutil.copy2(request.POST['file'],file)
Thanks.
...
I'm using Pylons to upload an image and store it to disk:
<form method="post">
<input type="file" name="picture" enctype="multipart/form-data" />
</form>
Then in my controller:
if 'picture' in request.POST:
i = ImageHandler()
#Returns full path of image file
picture_file = i.makePath()
shutil.copyfileobj(re...
For example:
>> print numberFormat(1234)
>> 1,234
Or is there a built-in function in Python that does this?
Thanks!
...
I'd like to find a way to get a title to truncate if too long, like this:
'this is a title'
'this is a very long title that ...'
Is there a way to print a string in mako, and automatically truncate with "..." if greater than a certain number of characters?
Thanks.
...
I currently have one Pylons website running on my server that is setup using nginx as a proxy to Paster. In the near future, I plan to host another Pylons site on the same server.
If I were to go the same route and use nginx+Paster, it would mean running two paster instances on different ports and then using the one nginx server as a pr...
I have a base.mako template with a if statement to include or not jQuery
<head>
% if getattr(c, 'includeJQuery', False):
<script type="text/javascript" src="jquery.js"></script>
% endif
...
Several templates inherit from base.mako, someone needs jQuery, someone don't.
At the moment I have to set the attribute in the controller be...
Hi everyone !
How to validate words divided by a comma by FormEncode ?
Something like this:
"foo1, foo2, foo3" -> ["foo1", "foo2", "foo3"]
...
I need to generate a URL for use as a callback in an external system in my pylons application. This requires me to provide both the pylons-app-relative controller path (as generated by the url method:
>>> relative_url = url(controller='my_cont', action='callback', id=generated_id)
>>> print relative_url
/my_cont/callback/1234
However,...