Archive for September, 2008

DjangoCon day two

Monday, September 8th, 2008

Almost sleeping, but there’s still a bit of caffeine in my body to write this post.

Some notes on day two:

  • In São Paulo we had two lighting talks before the “official” conference. João (JS) talked about a little script he wrote that uses PyGame to display text from a .txt file in a presentation format. Rbp explained a bit about 2to3 (the Python 2.x [actually x equals 6] to Python 3 conversion tool) and showed some examples.
  • First talk. Mark Ramm had some good points. Specially, IMO, about making Django more modular, which means that each part of it doesn’t depend on other parts of the framework. As an example, you can choose to use the Django ORM without using Django. But, please, don’t make it a lot of little packages that you need to grab together to start using the framework. One of the nice things about Django is that it’s simple to start using it (install one package and then django-admin.py startproject)
  • Official lighting talks. As always, a great moment on any Python conference. Lots of curious and interesting stuff (and other stuff not so interesting… or not interesting at all :-P [for me, obviously]). Funny moment: People, don’t use GMail over HTTP, there IS HTTPS support :-)
  • Schema evolution, three options: DMigration, South and Django Evolution. There are a lot of doubts about each one and I think I need to test all of them to choose one (and hope that they start collaborating to each other and make something really good). But it’s great to see that there is people working on that.
  • Last talk was Django’s Future by, obviously, Jacob and Adrian. It was more like a chat between them. Some good ideas and discussions. Then they received questions/requests/suggestions from the public. Things like, dropping old python versions support, python 3 support, documentation, debugging tools, etc. I think that some suggestions/requests were really nice and I hope that Django developers (and the community) take them seriously. This was a great opportunity for developers to receive feedback from the community (users).

That’s it for 2008. Again, I’d like to thank Rodolpho and Google for making it possible to attend to DjangoCon from São Paulo. Congratulations to DjangoCon organizers and to the Django community!

And, of course, thanks GruPy-SP people :-)

Pictures: Rbp’s DjangoCon set @ Flickr

DjangoCon @ Google (SP)

It was 11p.m. Almost sleeping in this blue big puff :-)

DjangoCon first day

Sunday, September 7th, 2008

I’m attending to DjangoCon from São Paulo Google’s Office.

Some notes on the first day of event:

  • I expected more news from GvR on his talk about GAE (nothing really new).
  • David Cramer talk about High Performance was kinda heavy (but good things learned)
  • The history behind Django is hilarious (State of Django by Jacob and Adrian)
  • It seems Django is getting bigger (contributors) and better (features). Good!
  • Really good talk by Malcolm Tredinnick about the Django ORM
  • GeoDjango seems very interesting, but it’s not for me (at least now…)
  • Cal Henderson made good “feature requests” and “bug reports” live, the unreadable SQL generated by Django scares me a bit… but not that much

In general it was great. I can’t wait for the lighting talks tomorrow (probably the best moment on any Python conference :-) ).

Oh, the snacks @ Google (Sao Paulo) are awesome!

Modifying Django NewForms-Admin views

Friday, September 5th, 2008

Playing with the new Django features, specially with the NewForms-Admin, I was looking for a way to change the add view behavior for some models.

It’s really easy and obvious (it’s always easy and obvious with Python and Django).

First, you’ll need the admin.py file in your app directory.


from django.contrib import admin
from myproject.myapp.models import MyModel

class MyModelAdmin(admin.ModelAdmin):
def add_view(self, request):
if request.method == 'POST':
# do whatever you want
# remember, POSTing means that someone entered data.
return admin.ModelAdmin.add_view(self, request)

admin.site.register(MyModel, MyModelAdmin)

The add_view method is called when you try to add an entry using the admin. There are other interesting methods you should look too, for customizing the admin behavior (change_view, delete_view, etc).

Another way to customize things is to write your own ModelForm, but it’s beyond the scope of this post :)

DjangoCon in São Paulo

Thursday, September 4th, 2008

I’m not crazy at all. (yet)

Thanks to Google (I think specially to Rodolpho) DjangoCon will be transmitted to Google’s Office in São Paulo while the conference is held in Mountain View.

Cool :)

I’m definitively going! So, Saturday and Sunday (September 6th and 7th) @ Google’s Office, see you there!