I think that will work Malcom. One thing we'll need to deal with,
is .name, .attname, etc on these. It should act the same way on the pk
as it does on the multi-column field (because after all, this will be
just a wrapper). Right now .pks is just an alias for .pk.as_tuple or
something. I had it throwing errors if you tried accessing .pk.name if
there were multiple fields in it, as name is the field name, and the
field name becomes multiple.

I will post up what I have done later tonight.

On Sep 16, 9:36 am, Rock <[EMAIL PROTECTED]> wrote:
> Malcolm,
>
> I strongly concur with the proposed API. It looks like it can be used
> to implement future RangeHash partitioning support. Consider:
>
> I have a model to be partitioned that has an IntegerField that will
> become the range partitioning value:
>
> week = models.IntegerField() # 1 to 53 depending on the week of
> creation
>
> The hash partitioning value is a field that works precisely like "id":
>
> hash_id = models.IntegerField( auto_everything=True ) # (I made
> "auto_everything" up as I am not sure precisely what parameters I need
> to set in order to make this happen.)
>
> Now I can create my RangeHash partitioning primary key with a
> compositeField:
>
> range_hash = models.CompositeField( hash_id, week, primary_key=True )
>
> What I am doing today for my partitioned models is to use the
> automatically generated "id" field, but that looks dicey with the
> CompositeField since you can't do this:
>
> range_hash = models.CompositeField( id, week, primaryKey=True )
>
> since "id" doesn't exist yet and, by designating this CompositeField
> as the primary key, id won't be generated. Rather than try to special
> case this situation, ensuring that I can create a field that works
> precisely like "id" by hand and then using that seems to be the way to
> go.
>
> Rock
--~--~---------~--~----~------------~-------~--~----~
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