On Sun 22 Jul 2007, Adrian Holovaty wrote:
> On 7/11/07, Peter Nixon <[EMAIL PROTECTED]> wrote:
> > I have added a patch to Ticket #399 at:
> > http://code.djangoproject.com/attachment/ticket/399/django-bigint-200707
> >11.patch
>
> A few days ago, I added a hook to the database Field class -- a
> db_type() method -- along with some documentation on how to create a
> custom database field type:
>
> http://www.djangoproject.com/documentation/model-api/#custom-field-types
>
> I'm not necessarily saying we shouldn't add a BigIntegerField as one
> of Django's built-in types;

Good. Could you give me some feedback on what, if anything needs to be done 
to my patch to make it acceptable? I'm new to the Django project, so I 
apologise if I am speaking out of turn here, but it is disheartening to have 
zero feedback from any core developers (until now) regarding a patch I 
submitted 2 weeks ago which appears to meet all the necessary criteria for 
inclusion (ie. It covers all backends including MSSQL which others have said 
is basically unmaintained at present)

> I'm saying this new hook could help you 
> out in the interim. It's as easy as doing this:
>
> class BigIntegerField(models.IntegerField):
>     def db_type(self):
>         return 'bigint'
>
> ...then use BigIntegerField() in your model.
>
> Note that there *might* be some validation issues to sort out -- i.e.,
> Django will use the default IntegerField validation in the admin, and
> that validation might be too strict -- but I forget whether the
> IntegerField validation checks that the value is in a given range.

Thanks. This appears to be a cool feature for adding DB specific support for 
fields which are a subset of another field (eg INET would fit in VARCHAR). I 
think that this would not work for BIGINT though, or at least it 
shouldn't... If it does, then the validation for IntegerField is wrong at 
present in Django!

-- 

Peter Nixon
http://peternixon.net/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to