Tag: frameworks

Taking control of Lift’s snippet rendering

Posted by – September 26, 2009

One of the features that I always pay attention in a framework is how we can control what can be rendered in a view and what not, many frameworks uses a scriplet language, some others uses a kind of template system for this purpose and a few give to the user a object oriented way to do it.

In this article I’ll show an example of how we can take the control of view rendering on lift framework with the help of snippets. With snippets you will be able to perform any server side interaction that you need, you can call a snippet by placing a tag on view code, this tag has a naming convention required to call the snippet properly, a snippet always emmit markup back to the user.


Changing field widget attributes from view code

Posted by – February 3, 2009

Yesterday I finally wrote my first Django application, this application is a basic crud that contains two pages, one to list costumers and another to change costumer data.

My biggest challenge was related with some form features, with Django forms you can programatically create a view form that contains several fields with its constraints and optionally associate a Django widget with this field. Django forms also have a very powerful validation engine and some form field constraints must be defined for this purpose.

This application uses the same page for two purposes, to add new data or edit data, in this scenario I must use a hidden field to be used as flag indicating in which mode the page is, adding or editing data, I must also change the readonly attribute of input widget used by costumer id form field since the user can’t change costumer id.


Evaluating Django

Posted by – September 1, 2008

In the next weeks I’ll try to take a closer look on this framework, it has a lot of nice features, one of then is your O/R mapper, very easy to work with, you can create your database using the model classes by running few commands, giving an idea about how much productive this framework can be for database driven applications.

Here’s a example of django model classes:


from django.db import models

class Friend(models.Model):
    name = models.CharField(max_length=200)
    phone_numer = models.CharField(max_length=200)
    birth_date = models.DateTimeField('birth date')

You can generate the application database containing “friend” table by just running the command python manage.py sql appname and python manage.py syncdb.

But the model layer isn’t enougth on a web application framework, we still still need consider the controller and view layers.


dojo 0.4.0 com drag and drop bugado

Posted by – November 8, 2006

Mal lançaram essa versão e já encontrei um bug chato, todos os meus componentes de drag funcionam normalmente, porém a comunicação de eventos do dojo está meio estranha e os componentes de drop não percebem a presença de componentes sendo arrastado sobre eles.

Um exemplo típico disso é o test_nested_drop_targets.html presente na pasta tests da distribuição do dojo.