Re: Patch: adding a msg parameter to assertContains and similar methods in the test client

2009-10-11 Thread Sean Bleier
> > > > def assertFormError(self, response, form, field, errors, msg=None): > >... > >self.fail(msg or "The field '%s' on form '%s' in context %d" > > " contains no errors" % (field, form, i)) > > would become: > > prefix = msg and "%s: " % msg or "" > self.

Re: Finalizing model-validation: ComplexValidator

2010-01-02 Thread Sean Bleier
Honza and Joseph (and others), thanks for all your work on this. It seems to me that we are unnecessarily tying complex validators to model fields. I would rather like to see complex validators tied to the model as a Meta option since all the fields are in the validator's domain. This would get

Re: URL dispatcher slow?

2012-10-11 Thread Sean Bleier
JKM, I'm wondering if it would benefit the community to house djangobench under https://github.com/django to give it more visibility. Just a thought. On Thu, Oct 11, 2012 at 9:45 AM, ptone wrote: > > > On Thursday, October 11, 2012 1:21:09 AM UTC-7, Russell Keith-Magee wrote: >> >> >> That said

Re: contrib.staticfiles app concerns

2010-10-20 Thread Sean Bleier
I agree with Carl, > Staticfiles has a very specific, well-defined purpose (collecting media > files from apps), which fills a major hole in the Django "story" for > reusable apps. IMHO contrib apps should have the following characteristics (and probably more): * Solves a problem that can be des

Javascript Testing

2011-06-17 Thread Sean Bleier
Hello everyone, A couple months ago I started work on a django branch [1] (with the help of @jezdez) that introduces a framework for writing javascript unit tests using QUnit[2]. I started with QUnit because Django already included jQuery in the admin and seemed like a natural extension, but it w

Re: Javascript Testing

2011-06-20 Thread Sean Bleier
Hi Luke, This looks like it could be really interesting or useful, but at the > moment I can't quite see my way to working out how to use it. I'd really > like to be able to: > > 1) apply a patch (or two) to my copy of Django > Would you like me to attach a patch to a ticket? I could attach it to

Re: Predicate as suggested new feature to extend url resolver process

2013-05-22 Thread Sean Bleier
I think what Rach is suggesting is different from @require_GET, @require_POST, etc. The patch essentially makes a view invisible if the predicate function returns False. I'm not sure this would be good for inclusion to django, since you are tying url resolution to application state . This could h

Re: Add support for get_or_none?

2014-03-13 Thread Sean Bleier
I like the implementation referenced in the SO thread, but I would just point out that `.get_or_none()` should accept both *args and **kwargs. `Q` objects can be passed in as arguments to `.get()` and `.filter()`, so it's only natural to allow that for `.get_or_none()`. On Thu, Mar 13, 2014 at 10

Re: Feature request: ttl method for cache

2014-05-05 Thread Sean Bleier
Hi Piotr, For what it's worth, I have an implementation of ttl on django-redis-cache: https://github.com/sebleier/django-redis-cache/commit/626a3263c428cf59b1428f5fc2aa638efd77346a It's slightly different from your snippet in that if the key does not exist (because it is expired or didn't exist i

Re: Make url patterns group kwargs more simple

2014-05-28 Thread Sean Bleier
You might want to check out Surlex[1], written by Cody Soyland. It basically does what you want. [1] http://codysoyland.com/projects/surlex/documentation/ On Wed, May 28, 2014 at 8:54 AM, Alexandr Shurigin < alexandr.shuri...@gmail.com> wrote: > Hi all. > > What do you think about adding some

Re: Adding UNION/INTERSECT/EXCEPT to the ORM

2017-01-11 Thread Sean Bleier
> > We cannot use the name "QuerySet.except()" since except is a reserved word > in Python. Do you prefer minus() (as suggested by Florian), except_() (as > done by SQLAlchemy), or something else? > > Can I suggest using "QuerySet.difference"? It's what python's sets use for achieving the same fu