On 8/17/06, 一首诗 <[EMAIL PROTECTED]> wrote:
>
> Hi all!
>
> Django provides a Ip Address Field.  But actually it's a CharField with
> some IP formate check.

You can definitely subclass db.models.Field, or you can subclass any
of its subtypes, such as IntegerField or IPAddressField. You might
want to read through the source to the Field class, though, to see how
the built-in fields work -- the interaction between the field and the
manipulators is not easy to see at first glance.

I would expect that you could subclass IPAddressField, and just change
the way that the value is stored in the database. (Override the
get_internal_type method to return "IntegerField" at the very least)

Regards,
Ian Clelland
<[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to