Aah, ok.  I think this might work:

exclude(number_iregex = r'^(1?(281|832|713|800).*|.{,6})$')

That excludes anything that matches your existing pattern or which is
exactly six characters or less.  Please be sure to test it though as this is
off the cuff. :)

  -- Scott

On Wed, Jul 2, 2008 at 12:16 PM, mike171562 <[EMAIL PROTECTED]>
wrote:

>
> Scott,
>
> Thanks, I'm already using long_distance =
> call.exclude(number__iregex=r'^1?(281|832|713|800)')
> to filter long distance numbers so, the new regex would be
>
> something like iregex=r'^1?(281|832|713|800)^.{7,}')
>
> does that look right?
>
>
> On Jul 2, 11:04 am, "Scott Moonen" <[EMAIL PROTECTED]> wrote:
> > Mike, you might try this:
> >
> > call.filter(number__regex = r'^.{7,}')
> >
> > That uses a regular expression that matches strings of length 7
> characters
> > or more.
> >
> >   -- Scott
> >
> > On Wed, Jul 2, 2008 at 11:59 AM, mike171562 <[EMAIL PROTECTED]>
> > wrote:
> >
> >
> >
> > > hello,
> > >        I am working on a web app that pulls call logs from a database
> > > and displays them.  I am working with the greater than and less than
> > > functions to filter out phone numbers less than 7 digits long i.e.
> > > internal extensions. When I use something like
> > > call.filter(number__gte=7) however, it filters  me the value and not
> > > the length. Does anyone know of a way to query for length of a number
> > > and not the actual value?  thx in advance.
> >
> > --http://scott.andstuff.org/|http://truthadorned.org/<http://scott.andstuff.org/%7Chttp://truthadorned.org/>
> >
>


-- 
http://scott.andstuff.org/ | http://truthadorned.org/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to