In PHP, I often use the conditional operator to add an attribute to an html element if it applies to the element in question. For example:
<select name="blah">
<option value="1"<?= $blah == 1 ? ' selected="selected"' : '' ?>>
One
</option>
<option value="2"<?= $blah == 2 ? ' selected="selected"' :…
I periodically get this problem where all of a sudden mako is using old versions of templates, and it's not until I manually go and update the template files that they'll use the current version. I'm using
./manage.py runserver
I think it's usually after I update using source control, but it's intermittent, and I can't reliably reproduce the…
In trying to add a cached section to a Mako template, I get the error listed in the above question. Adding () to the end gets rid of the error, but I see no content on my page. Any help is appreciated!
<%def name="test" cached="True" cache_timeout="60" cache_type="file">
Test
/%def>
Hi guys,
I'm making a website that mail users when a movie or a pc game has released. It isn't too complex - users can sign up, choose movies/music or a genre and save the settings. When the movie/music is released - it mails the user. Some other functionality too but this is the jist.
Now, I've been working with Python for a bit but mainly…
I have a template variable, c.is_friend, that I would like to use to determine whether or not a class is applied. For example:
if c.is_friend is True
<a href="#" class="friend">link</a>
if c.is_friend is False
<a href="#">link</a>
Is there some way to do this inline, like:
<a href="#" ${if c.is_friend is…
I'm trying to use TemplateLookup from Mako, but can't seem to get it to work.
Layout of the test site is:
/var/www
main.py
templates/
index.html
Nginx's config is setup as:
location / {
fastcgi_pass 127.0.0.1:8080;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param SERVER_PORT $server_port;
…
In PHP, I often use the ternary operator to add an attribute to an html element if it applies to the element in question. For example:
<select name="blah">
<option value="1"<?= $blah == 1 ? ' selected="selected"' : '' ?>>
One
</option>
<option value="2"<?= $blah == 2 ? '…
I'm getting an error:
GenerationException: url_for could not generate URL. Called with args: () {}
from this line of a mako template:
<p>Your url is ${h.url_for()}</p>
Over in my helpers.py, I do have:
from routes import url_for
Looking at the Routes-1.12.1-py2.6.egg/routes/util.py, I seem to go…
We sell a whole site (domain, etc) to partners that create content that is shown together at the main site. What we want to achieve is that the main site copy is the original, but the one that is indexed is the partners copy. We want to do it this way so the search results point to the partner sites but never to the…
hello guys,
one question that is been bogging me...
first of all I want to say that I actually come from a third world country, so I am all up for opportunities for everybody...
so here comes my consideration,,, I have been working as a programmer for Iphone apps (noob in the company), now in my new "first" world…
hi guys,
I got a gift from a friend, 2 readers for RFID, and some cards (from a Chinese company called daily rfid),
the kind of work, because it comes with some demo software written in Delphi, that reads the id of the card (myfare compatible, ISO14443A )
but the problem is that if I try to use the demo to write to…
If this is not the right place to ask this question please inform where it would belong, to change it...
I have a doubt for the correct word or concept in english language [not my native], about the relationship of
language to framework
for example i work with
objective C, with the cocoa touch frame…
I use Virtual Box on a Mac OS X 10.6.2 MacBook Pro.
Can I create/run a Mac OS X 10.5 guest OS on this setup?
If not, what setup would allow me to run multiple versions of Mac OS X on the same machine?
I need that directory, as I want to put my sites there, so that apache can run them..
It is my virtual directory path.. and I am new to linux.. I just want to read and write from that directory.. How do I enable creating/saving/reading files/folders from that directory?
What command do I give?
I tried a few,…
My goal is to allow people to upload and download large files through their web browser with a simple user interface and user password/account management. Yousendit offers a service like what I am looking for, but it does not make sense to use their service if I already have a web server.
Is there an open…
hi, please help with this noob questions but really making me go crazy
if I create a project from scratch (using windows based app) for the ipad,
and add a tabbar , with firstviewController, and secondviewController, it works fine,
starts in landscape mode,
but in info.plist I set it to Landscape(left…
I'm working with GWT and I'm trying to add google-maps to my website.
Since I want to use google-maps V3 I'm using JSNI.
In order to display the map in my website I need to create a div element with id="map" and get it in the initialization function of the map. I did so, and it worked out fine but its…
im installing django,
the test for wsgi is ok, but when i point my default file to the django test, it doesnt work,
this is the test that works fine:
default: /etc/apache2/sites-available/default
<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com
…
hi,
I installed a new device (the second out of the 100), on xcode,
an iPod touch
but when I upload the app, the iPod crashes, apple logo shows, and gets frozen for a while, and then resusitates,
in the xcode, I get the message on console: The Debugger has exited due to signal 15…
I have a list of dates and IDs, and I would like to roll them up into periods of consucitutive dates, within each ID.
For a table with the columns "testid" and "pulldate" in a table called "data":
| A79 | 2010-06-02 |
| A79 | 2010-06-03 |
| A79 | 2010-06-04 |
| B72 | 2010-04-22 |…
The following is my oauth template
top.location.href='https://graph.facebook.com/oauth/authorize?client_id=${config['facebook.appid']}&redirect_uri=${config['facebook.callbackurl']}&display=page&scope=publish_stream';
Click here to authorize this application
When…
While trying to install deluge 1.3.3 (I need this specific version) I get an error.
I install all the needed packages through
sudo apt-get install g++ make python-all-dev python-all python-dbus \
python-gtk2 python-notify librsvg2-common python-xdg python-support \
subversion…