Re: Custom prefetches (#17001)

2013-08-26 Thread Chris Adams
On Friday, August 23, 2013 11:25:42 AM UTC-4, Andrew Ingram wrote:

> Essentially, I'm wondering if extending the prefetch_related concept is 
> the right approach, and whether it's instead worth exploring the more 
> general idea of "attaching stuff to models at the ORM level". There're a 
> lot of useful concepts from other ORMs related to attaching prebuilt data 
> structures like arrays, dicts, calculated values, filtered annotations, etc 
> to models. The problems all seem somewhat related, and I'm worried about 
> the possibility of solving them all in completely different ways.
>

I've found simonw's django-queryset-transform 
incredibly 
useful for this class of work in the past for precisely that reason. The 
proposed API above would work for my most common use (filtered prefetches, 
e.g. loading object translations in the current language) but in most cases 
I've been able to get significant benefits by doing things like using 
.values_list() to attach only the fields I actually need or retrieve 
certain common lookups from a cache. Being able to run pure Python code 
makes this rather easy and reduces the temptation to cram too much logic 
into an ORM chain.

Chris

-- 
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-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.
For more options, visit https://groups.google.com/groups/opt_out.


Admin accessibility tweaks

2010-02-24 Thread Chris Adams
We've been collecting various tweaks to the stock Django 1.1.1 which
have been requested by our 508 testers. I'd appreciate it if someone
could review these tickets:

Add scope=col to changelist table headers:
http://code.djangoproject.com/ticket/12957

Add alt text to SelectFilter2's filter widget:

http://code.djangoproject.com/ticket/12959

SelectFilter2 loses help_text - not a pure accessibility issue but it
can cause confusion in some cases:

http://code.djangoproject.com/ticket/6183

Feedback on streamlining these reports is welcome - I don't think we
have too much else but I'm still waiting for details about the issues
reported on all of our projects.

I'm tracking our changes here:

http://github.com/acdha/django/commits/1.1.1-508-fixes

Thanks,
Chris

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: Proposal for 1.2: Dumber email validation

2009-10-15 Thread Chris Adams

On Oct 10, 9:35 am, James Bennett  wrote:
> So what I'd like to propose is that EmailField essentially check that
> the value contains an '@', and a '.' somewhere after it. This will
> cover most addresses that are likely to be in actual use, and various
> confirmation processes can be used to rule out any invalid addresses
> which happen to slip through that.

Good idea - every real project I've had where this became an issue had
to switch to some sort of actual mail-based validation system
(confirmation, live MX connection, etc.). Adding doc links about email
validation tools would be better because it'd establish that this is
something which deserves some thought if you rely on email addresses.

Chris
--~--~-~--~~~---~--~~
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 
django-developers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~--~~~~--~~--~--~---