def resolve_url(to, *args, **kwargs):
 if hasattr(to, 'get_absolute_url'):
  return to.get_absolute_url()
 try:
  return urlresolvers.reverse(to, args=args, kwargs=kwargs)
 except urlresolvers.NoReverseMatch:
  if callable(to):
   raise
  if (('/' not in to) and ('.' not in to)):
   raise
 return to

def resolve_url ( to , * args , ** kwargs ) : if hasattr ( to , 'get_absolute_url' ) : return to . get_absolute_url ( ) try : return urlresolvers . reverse ( to , args = args , kwargs = kwargs ) except urlresolvers . NoReverseMatch : if callable ( to ) : raise if ( ( '/' not in to ) and ( '.' not in to ) ) : raise return to
return a url appropriate for the arguments passed .