BOMBOLOM.COM

If you found the info on this site usefull,
please support us by consulting the ads on the left.

(python) Linear Interpolation

By José Lopes

Though the Python math library has the linear interpolation that, if I'm not mistaken, requires the adjacent points to the point we need the interpolation, I created my own function to do it.
I did it because I needed to do many interactions where the adjacent points changed, and also because I failed to check first if Python had the linear interpolation function!

With this post I share my solution to anyone interested. It may come in handy if you are calculation several points with a bunch of initial data. Have a look!

2009.08.02 | There's more... | Comments 0 | Tags ,

(django) Order_by using case insensitive

Posted by José Lopes

This post shows how you can sort a QuerySet assuring a case insensitive ordering.

2009.06.18 | There's more... | Comments 0 | Tags ,

(django) Custom Template Context

Posted by José Lopes

I needed to use a constant that I defined on my project settings on several templates. I wanted to be able to use it like:

{{ MY_CONSTANT_NAME }}

I started by passing it on each view context but then, remembering the DRY principle, I made use of the TEMPLATE_CONTEXT_PROCESSORS to make it available anywhere on the project templates.

This post will show you how to create your own template context or, using the correct name, Custom context processors as its mentioned in the Django's documentation.

2009.05.12 | There's more... | Comments 0 | Tags , ,

(django) Concatenate QuerySets

Posted by José Lopes

In some situations you may want to concatenate two QuerySets.

The solution depends whether the QuerySets have the same model or not, and this post shows both solutions.

The information presented was based on this thread.

2009.02.06 | There's more... | Comments 0 | Tags ,

(python) S-exp Scanner in Python

By: Helder Guerreiro.

In the last year and a half I've been programming (very slowly I admit) a web mail client written in Python. The objective is to have more or less the same feature set that Squirrelmail has.

You can check the result of my efforts here. Please be advised that this software is on its early stages and far from complete, it was only tested with Cyrus IMAP which is a very standard compliant IMAP server, so, if you test the program with other less compliant servers it may fail to work.

By now you've guessed that I'm using the IMAP server as the backend storage system for the web mail client. Since the IMAP server responses are symbolic expressions (s-exp for short) I needed a fast enough scanner to be able to parse the server responses. Note that this responses can be a bit lengthy and complex.

I'll try to show how I've solved this problem in the context described above.

2009.02.02 | There's more... | Comments 0 | Tags

(django) Admin Widgets vrs User Forms (AdminDateWidget)

Posted by José Lopes.

The Django administration has a couple of widgets that can be used in an user's form.

This is mentioned on the Django's documentation ( Media and Django Admin) but no practical example is given. Searching the web we find that a lot of people have tried to use them without success, specially the AdminDateWidget that provides a nice popup calendar for choosing the date.

This post show how one can use this widget, and explains why there have been so many missing attemps.

The information here presented is also valid for the AdminTimeWidget. Other widgets may be subject of future posts.

2008.09.07 | There's more... | Comments 1 | Tags , ,

(django) Django Version 1.0

The first official Django version is out. All posts concerning Django that may follow this one have as object this Django version.

2008.09.07 | There's more... | Comments 0 | Tags

(databases) Theory: 2 - Relational Databases

Posted by José Lopes.

This post goal is to explain in general what is a relational database and some associated terminology. Its useful to have an idea about this type of database and its management system to understand better the process of database design (to be treated in another post)

2008.05.31 | There's more... | Comments 0 | Tags , ,

(django) Compose Field and set Unique

Posted by José Lopes.

This post shows how to create a model in Django with an attributes composed by other two, assuring its unicity.

2008.05.23 | There's more... | Comments 0 | Tags ,

(databases) Theory: 1 - Database e Database Management System (DBMS)

Posted by José Lopes.

This post initiates a series about databases. On a first part I will write about the database theory leaving for a later occasion other subjects like SQL.

The theoretical part will consist in what is a database and a database management system (DBMS), in focus on this post, what is a relational database, some terminology to be aware and finally the process description of a database design.

The goal with this set of posts is not to write in detail about subjects that you can easily find on the web, but is to structure some concepts that we then to neglect during our daily activities and that end to be decisive to our project success.

2008.05.14 | There's more... | Comments 0 | Tags ,

Page 1 of 5  >>
Made with PyBlosxom | Add to Google