Reloading a project without restarting Python

2012-04-07 Thread Tobia Conforto
Hi all I'm developing a portlet bridge in Jython, to enable developing J2EE portlets in Django, and I need to include a reload-on-code-change feature, to aid in development. Unfortunately, the way django.utils.autoreload works, by triggering a complete restart of the Jython interpreter, has huge

Re: New design for class-based views

2011-12-06 Thread Tobia Conforto
On Dec 5, 6:37 pm, Reinout van Rees wrote:> That link will expire in a month, so that's not really suited to posting> on a mailinglist that people might still read a month from now. You're right. Here is another link: http://pastebin.com/w7u74AJ7 On Dec 5, 4:07 pm, sebastien piquemal wrote: > Cou

Re: New design for class-based views

2011-12-06 Thread Tobia Conforto
On Dec 5, 12:56 am, Russell Keith-Magee wrote: > On Sun, Dec 4, 2011 at 12:43 PM, akaariai wrote: > > I don't know much about class based views, but I do know that their > > design thread at django-developers was _very_ long. So, there might be > > reason why things are done as they are. > > Inde

New design for class-based views

2011-12-03 Thread Tobia Conforto
Hello As you may know, current class-based views have been criticized for their complexity. Their design is a bit convoluted and difficult to understand by the average view author and therefore any work made with them may hide sneaky bugs. On top of that, it's difficult to apply common decorator

Splendid issue with the login view, TransactionMiddleware, and DEBUG mode

2011-11-10 Thread Tobia Conforto
Phew! I just finished wrestling with a TransactionMiddleware ordering issue. Basically, if TransactionMiddleware is after SessionMiddleware (as suggested by the docs*) then a login operation, as done by the default login view, is only committed to the session when Django is running in debug mode.

Default doctest options

2011-11-08 Thread Tobia Conforto
Hi Is there a recommended way to set default doctest options? (per doctest, per app, or even per project would be ok) I'm thinking of REPORT_NDIFF in particular, which is essential when testing large xml serializations and such. Tobia -- You received this message because you are subscribed to

Python data structures and the GIL

2011-11-06 Thread Tobia Conforto
I have a Django app that does some heavy calculations for the user. At the start of a user's session it parses some source data and builds a complex data structure, in the form of big trees of cElementTree nodes (by themselves fast and small, being written in C). Then it allows the user to query a

Re: Subclassing the ForeignKey field type

2011-10-24 Thread Tobia Conforto
Hi Guy I do think my approach is better. Remember the Django motto "Don't Repeat Yourself"! The serialization logic belongs to a library class, not in your models. I can't give you my entire code (it belongs to my employer) but I can point you to the right direction. -Tobia # your model: class

Re: Subclassing the ForeignKey field type

2011-09-28 Thread Tobia Conforto
Konk wrote: > As for what you are doing, I don't think subclassing ForeignKeys is > the way to go. Currently they defer most of the work to their target > fields, you might try to do something similar with the features you're > trying to add. Problem solved: I just didn't have to put __metacla

Subclassing the ForeignKey field type

2011-09-15 Thread Tobia Conforto
Hi all I'm adding an XML mapping feature to Django db models. The idea is to add as little XML mapping information as possible to existing models (such as: which fields get mapped to XML, what is their XPath...) in order to be able to automatically: 1. produce an XML representation of an object