class QueryDict(dict): """dot.notation access to dictionary attributes""" def __getattr__(self, attr): try: return self.__getitem__(attr) except KeyError: raise AttributeError( "%r object has no attribute %r" % (self.__class__.__name__, attr) ) def __setattr__(self, attr, value): self.__setitem__(attr, value)