Re: Bitwise operations in QuerySets?

2015-03-16 Thread Charlie Hayes
How do you evaluate if something is common enough to warrant inclusion?

-Charlie

On Tuesday, October 30, 2007 at 9:14:09 PM UTC-5, Malcolm Tredinnick wrote:
>
> On Tue, 2007-10-30 at 17:03 -0400, George Vilches wrote:
> > What I want to do:  Assume I have an integer column in a table that 
> > contains a value that I want perform a bit operation on.  I would like 
> > to able to make a QuerySet that generates a query similar to this: 
> > "SELECT * FROM table WHERE column & 4;". (example is MySQL-friendly).
> > 
> > I've looked around both in the current DB layer and in 
> > Queryset-refactor, but it's possible I've missed something.  If this 
> > already exists, then give me the shaming I deserve.  Otherwise...
> > 
> > 
> > Would anyone object to it being just another __ operation?  For 
> > instance, Poll.objects.filter(column__bitand=4).  Is there a preference 
> > whether this should be __and or __bitand?
>
> Yeah, I'd object. I don't see it as common enough to warrant inclusion.
> You can achieve the same functionality either with extra(where=...) or a
> custom Q-like object, so I'm inclined to leave it out of core.
>
> By the way, in the queryset-refactor Q-like objects will have access to
> the full query class, which includes the model, so you'll be able to
> write something like Bit(foo__and=4) and when it comes time to produce
> the SQL, your Bit class will be able to work out the right column name
> for model field "foo".
>
> Regards,
> Malcolm
>
> -- 
> Quantum mechanics: the dreams stuff is made of. 
> http://www.pointy-stick.com/blog/
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/780c8a19-4b24-4adb-ad2a-964cfb4acb9e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Resolved: wontfix is not productive

2016-07-26 Thread Charlie Hayes
Ticket https://code.djangoproject.com/ticket/19447 was resolved as wont fix.

Although this PR is insufficient for our needs (we would also need 
localized abbreviations), it would certainly be more useful than the 
nothing that exists now.

How does the Django team know how many developers would use a feature like 
this when said developers never get a chance to use it? Django includes a 
lot of inane features that many fewer developers would use compared to 
this. The documentation for all of Django is already pretty bad (it's 
poorly organized, poorly hyperlinked, uses bad examples, etc, regardless of 
what others say); blocking a PR from acceptance because the documentation 
doesn't measure up to the bar set in practice is illogical.

Practically every site that prints numbers to the screen (read: all sites) 
could benefit from features like this. If the work is incomplete, let 
someone take over or explain what else needs to be implemented before 
acceptance is gained. Closing it as won't fix is irrational and discourages 
the community (and adoption of the framework).

-Charlie

PS: I can't add this as a comment to the ticket because:



-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/163e3b24-aa17-4f82-bc48-3104d3e0d203%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.