* Marty Alchin <[EMAIL PROTECTED]> [2008-05-15 10:45 -0400]: > > On Thu, May 15, 2008 at 10:25 AM, Amit Ramon <[EMAIL PROTECTED]> wrote: > > Now, if I subclass an existing field and I want to define the database type > > myself, how do I do that? Is there a place to add mapping between a name > > returned by get_internal_type and a database type, like in creation.py? > > Well, there are two ways to do it. First, like you now know, > get_internal_type() is preferred, if there's an existing mapping that > suits your needs. That allows the field to be used with multiple > databases, which is a big plus. > Thanks again for your elaborated answer. I did learn a couple of new things...
I asked this question not because I cannot find an existing mapping - currently the db type of django's PhoneNumberField is perfectly fine for what I need - but because I wanted to be sure I'm using a type that won't change. I feel confident to use generic types, but I was hesitating to use an existing mapping, which was created for some specialized field (for instance, what will happen if the implementation of django's PhoneNumberField will be modified in a way that would break my code...). It might be I'm just too suspicious. Anyway, for now I'll just go with the existing mapping. Many thanks again, Amit --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

