Posts

Converting unicode date to datetime object.

In a django template i had something like: value="{{ query_date|date:'%d/%m/%Y' }}" And in my view i wanted a date not an unicoded date. So i did this in a view to parse the unicode and convert it to datetime object.  from datetime import datetime query_date_obj = datetime.strptime( query_date, "%d/%m/%Y") Ciao!

The person that works the hardest wins.

Image
by BramVanhaeren.com

Combine two (or more) images in one using convert in command line

I you want to combine two or more images in one you can try using command convert . This program is member of the ImageMagick(1) suite of tools.  In my case, its already installed in my bash term, so i didn't install anything. If you want more information about this command you can go to ImageMagick site or just type man convert in bash How to use it: convert img1.jpg img2.jpg [img3.jpg ... imgN] +append new_img.jpg convert img1.jpg img2.jpg [img3.jpg ... imgN] -append new_img.jpg The + will append images  horizontally and the - vertically.

Carignano se va a Patronato de Paraná

Image
Mucha suerte genio ! Gracias por todo!

Sql statement for a query with the Django ORM?

from django.db import connection sql_statement = connection.queries.pop() print sql_statement['sql']

Forestello dejó de ser el Técnico de Atlético de Rafaela!

Image
Gracias por todo Yagui!

Dump sql file from sqlite3 db

[carpincho@bender]$ sqlite3 database.db3 .dump | grep '^INSERT INTO "tablename"' source