May 31, 2009 § 1 Comment
For the longest time I kept staring at ‘plain text mode’ while editing Mako templates. No Mas!
TextMate bundle for Mako template has existed.
cd ~/Library/Application\ Support/TextMate/Bundles/
svn co http://svn.makotemplates.org/contrib/textmate/Mako.tmbundle
After Reloading your bundle, syntax highlighting is available under HTML (Mako).
May 25, 2009 § 6 Comments
Do you have that problem? I do.
EDIT(05/31/2009): Even better solutions:
General CSS solution:
The HTML solution:
use <wbr>. (But you have to figure out yourself where to put the tag)
The IE-specific CSS solution:
wordwrap(‘your_very_long_string_here’, 15) // Break after 15 characters
textwrap.fill(‘your_very_long_string_here’, 15) # Break after 15 characters
May 25, 2009 § Leave a comment
Original Article here: http://lafalafu.com/krc/privilege.html
The article is thoroughly descriptive and I didn’t even realize some of them until I read it.
May 24, 2009 § Leave a comment
By default Mako HTML escapes all output.
To NOT have this behavior, change the setting of TemplateLookup in environment.py.
May 17, 2009 § Leave a comment
distance_of_time_in_words is a useful function that converts boring looking datetime into something more attractive (and SEO optimized) like: 30 seconds ago.
Pylons gain this functionality via WebHelper which blatantly inspired by Rails.
But, out of the box, this functionality does not exists in my templates. To enable it, I need to add this line in helpers.py:
from webhelpers.date import distance_of_time_in_words
May 16, 2009 § Leave a comment
May 15, 2009 § Leave a comment
distinct() method is accessible from Query object. The documentation is kind of obscure, so hopefully this post is helpful for others.
May 14, 2009 § Leave a comment
May 13, 2009 § Leave a comment