Re: Proposal: BitMaskField

2014-04-19 Thread CHI Cheng
t; https://github.com/disqus/django-bitfield ), but it supports neither >> Python 3 nor 1.7. I hope this field could get official supports. >> >> Syntax draft: >> https://github.com/chicheng/deps/blob/bitmaskfield/drafts/BitMaskField.md >> >> Chi >> >> >

Re: Proposal: BitMaskField

2014-04-18 Thread Russell Keith-Magee
ld ), but it supports neither > Python 3 nor 1.7. I hope this field could get official supports. > > Syntax draft: > https://github.com/chicheng/deps/blob/bitmaskfield/drafts/BitMaskField.md > > Chi > > > -- > You received this message because you are subscribed t

Proposal: BitMaskField

2014-04-18 Thread CHI Cheng
: https://github.com/chicheng/deps/blob/bitmaskfield/drafts/BitMaskField.md Chi -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developer

Re: BitmaskField

2008-12-07 Thread David Cramer
ECTED]> wrote: > Andrew: Thanks, that looks awesome. > > The whole BitMaskField(choices=LIST) idea scares me.  You must then force > extra knowledge on the user that ordering is important.  If programmer Y > decides the list of choices looks better in alphabetical order (or decides

Re: BitmaskField

2008-12-06 Thread Craig Kimerer
Andrew: Thanks, that looks awesome. The whole BitMaskField(choices=LIST) idea scares me. You must then force extra knowledge on the user that ordering is important. If programmer Y decides the list of choices looks better in alphabetical order (or decides to add a choice in the middle

Re: BitmaskField

2008-12-06 Thread David Cramer
Awesome to see some people working on this. I had tried pre-queryset refactor and It was just not doable witht he fields API. Can't wait to see the final result of this :) I'm also agreeing with the API of field = BitMaskField(choices=LIST) On Dec 6, 10:37 am, Carl Meyer <[EMAIL PROTEC

Re: BitmaskField

2008-12-06 Thread Carl Meyer
@Andrew: Thanks! That's precisely the missing piece from my code; if I get some time to put it all together, I think it'll be a full solution. My approach uses sets of arbitrary flag values rather than creating constants for flags, and it's implemented as a normal model field, which seems a

Re: BitmaskField

2008-12-05 Thread ab
or that attribute's bitmask? So that you could somehow, approximately go BitCheck('flags', IS_FOO) Anyways, hope this all helps. Andrew On Dec 4, 2:16 pm, "Craig Kimerer" <[EMAIL PROTECTED]> wrote: > Apologies if this has been asked already and I have missed it in searching, >

Re: BitmaskField

2008-12-05 Thread Craig Kimerer
hing I would suggest is not to require the user to define the value > for each option, handle that internally. Have some sort of class to > encapsulate the public portion of that. > > Alex > > On Dec 5, 10:53 am, "Mike Axiak" <[EMAIL PROTECTED]> wrote: > >

Re: BitmaskField

2008-12-05 Thread alex.gay...@gmail.com
t; <[EMAIL PROTECTED]> wrote: > I seem to be missing something. Why is it that you cannot just write a > BitMaskField yourself outside of Django? > > I thought that it might have been that we don't have __any and __all lookup > types, but it seems you can override get_db_prep

Re: BitmaskField

2008-12-05 Thread Carl Meyer
I've written and am using a BitFlagsField, but hadn't yet shared it since I haven't been able to get the ORM lookup stuff working the way I want it. I've pasted my code-in-progress at dpaste: http://dpaste.com/hold/96435/ The current code includes a model BitFlagsField, a form

Re: BitmaskField

2008-12-05 Thread Mike Axiak
I seem to be missing something. Why is it that you cannot just write a BitMaskField yourself outside of Django? I thought that it might have been that we don't have __any and __all lookup types, but it seems you can override get_db_prep_lookup in a field, so that's not an issue. And if there do

Re: BitmaskField

2008-12-05 Thread George Vilches
pm, "Craig Kimerer" <[EMAIL PROTECTED]> wrote: >> Apologies if this has been asked already and I have missed it in >> searching, >> but is there any interest in taking a patch for a BitmaskField? >> >> Given the following (albeit stupid) example to sho

Re: BitmaskField

2008-12-05 Thread [EMAIL PROTECTED]
t; <[EMAIL PROTECTED]> wrote: > Apologies if this has been asked already and I have missed it in searching, > but is there any interest in taking a patch for a BitmaskField? > > Given the following (albeit stupid) example to show some usages that would > be nice to have on

BitmaskField

2008-12-04 Thread Craig Kimerer
Apologies if this has been asked already and I have missed it in searching, but is there any interest in taking a patch for a BitmaskField? Given the following (albeit stupid) example to show some usages that would be nice to have on a bitmask field. I should note in the examples below