On Mon, Feb 16, 2009 at 12:05 PM, alain31 <asoy...@free.fr> wrote: > > What I understood reading custom-model-fields.html is that Field class > only handle one column in database > (db_type method returns a database type...). I first thought to > inherit from TextField and build the name of the png file using a hash > from > the LaTeX string (so no need to store it in the database), or store a > string made of concatenation of LaTeX string + url > but I imagine that there must be a cleaner way to do it no? > > > > If you take a look at how Generic Foreign Key fields are used the user defines 2 fields on the model, and then the generic foreign key acts as a psuedofield(it exists in python, but not the DB) and combines the data from both those fields. That's how I would do it, take a look at django.contrib.cotnenttypes.generic to see how that's implemented.
Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---