Archive

Archive for the ‘Python’ Category

Django nonrel-search and pagination problem

Styczeń 4th, 2012

Do you use nonrel-search? Do you want to paginate your search results and it does not work?

Go and see this issue: https://bitbucket.org/Wilfred/nonrel-search/issue/4/slicing-issue-in-relationindexquery-class

The provided patch seems to work for me.

Django, Python

No module named fancy_urllib

Grudzień 17th, 2011

Got this error? No module named fancy_urllib? Is Django + Google App Engine your set up?

Probably you have GAE SDK in your PYTHONPATH. It should be in your PATH only, NOT PYTHONPATH (it's mentioned in installation manual but who reads them ... ;-) ).

Python

Python for Java developers: Ternary operator

Lipiec 25th, 2011

Probably you know the ternary operator syntax in Java (at least I hope so :-) ). Just as a reminder the syntax was:

 
    condition ? True_value : False_value
 

No question marks in Python!
Read more...

Python

Python for Java developers: list comprehension

Czerwiec 30th, 2011

If you are used to Java syntax (or another similar, verbose language), Python's list comprehension syntax might seem a little bit strange at first. However it is pretty straight forward and useful. I will try to show that on a few examples.
Read more...

java, Python