Re: IPy for settings.INTERNAL_IPS

2009-03-15 Thread Jeremy Dunck
Yeah, dumb bug. :) On Mar 15, 2009, at 4:12 PM, Ludvig Ericson wrote: > > On Mar 15, 2009, at 05:02, Jeremy Dunck wrote: > >> class CIDR_LIST(list): >> def __init__(self, cidrs): >> from IPy import IP >> self.cidrs = [] >> try: >> for

Re: IPy for settings.INTERNAL_IPS

2009-03-15 Thread Ludvig Ericson
On Mar 15, 2009, at 05:02, Jeremy Dunck wrote: > class CIDR_LIST(list): >def __init__(self, cidrs): >from IPy import IP >self.cidrs = [] >try: >for cidr in cidrs: >self.cidrs.append(IP(cidr)) >except ImportError: >pass >

Re: IPy for settings.INTERNAL_IPS

2009-03-14 Thread Jeremy Dunck
On Sat, Mar 14, 2009 at 11:05 PM, Alex Gaynor wrote: ... > Why are you subclassing list if you're going to just add a cidrs attr that's > the list :) I'm handling INTERNAL_IPS which are multiple CIDR blocks. I could have constructed with [IP('...'),IP('...')], but that's

Re: IPy for settings.INTERNAL_IPS

2009-03-14 Thread Alex Gaynor
On Sat, Mar 14, 2009 at 11:02 PM, Jeremy Dunck wrote: > > On Sat, Mar 14, 2009 at 6:33 PM, Rodrigo Guzman wrote: > ... > > So, it seems like it'd be a straight forward change to > > django.core.context_processors.debug to implement it. However, it > > seems

Re: IPy for settings.INTERNAL_IPS

2009-03-14 Thread Jeremy Dunck
On Sat, Mar 14, 2009 at 6:33 PM, Rodrigo Guzman wrote: ... > So, it seems like it'd be a straight forward change to > django.core.context_processors.debug to implement it.  However, it > seems that this functionality would be better placed in the settings > module. Django

IPy for settings.INTERNAL_IPS

2009-03-14 Thread Rodrigo Guzman
A propos of the recent discussion about the possibility of using IPy[1] to validate IPAddressField [2], I was thinking that ip addresses can be handled more robustly in the INTERNAL_IPS setting. The original use-case I had in mind was to allow the debug context processor to handle a list of