Re: Database model fields question

2008-12-02 Thread sned
Thanks for pointing me in the right direction. Here's the solution I came up with: import socket, struct class ipfield(models.Field): __metaclass__ = models.SubfieldBase def db_type(self): return 'integer' def to_python(self, value): retu

Re: Database model fields question

2008-12-01 Thread Daniel Roseman
On Dec 1, 6:48 pm, sned <[EMAIL PROTECTED]> wrote: > Is there a way to tell django to use a specific function when > selecting data from a model? > > The sql is relatively simple, but I don't know how to convert that to > model syntax. > > Here's the issue:  a table I'm working with stores ip addr

Database model fields question

2008-12-01 Thread sned
Is there a way to tell django to use a specific function when selecting data from a model? The sql is relatively simple, but I don't know how to convert that to model syntax. Here's the issue: a table I'm working with stores ip addresses as a 10 digit integer. To get the ip address out of that