Hi,
I am using the sites framework and finding it very useful but I would
prefer the Site.__str__ method to return the site name instead of the
domain. What is the best way of going about that? Is it reasonable to
monkey patch it or do I need to make my own sites app with a copy of the
code?
t;>
>> try:
>> getattr(obj, name)
>> return True
>> except: # yikes! naked except!
>> return False
>>
>> https://docs.python.org/2/library/functions.html#hasattr
>> So, excepting AttributeError will at least narrow down the error
>&g
Hi,
Thanks for the reply, but I'm not sure I follow. I was hoping that the
following might work:
if hasattr(sup_cls, 'media'):
base = sup_cls.media
else:
base = Media()
Would that swallow additional exceptions?
Cheers,
Michael
On Wednesday, September 3, 2014 10:45:22
Hi,
I love Django, it has been enormously useful to a new comer to web dev like
me.
One minor issue I've just had is that I've struggled to figure out an issue
with my code because an AttributeError I was generating in my media
property on my custom widget was being silently swallowed by:
4 matches
Mail list logo