Corrected Waldo AccountMultiView typo and improved View error reporting / TargetURL...
[philo.git] / models / nodes.py
index 09376b8..07a5e0a 100644 (file)
@@ -114,8 +114,8 @@ class View(Entity):
                
                try:
                        subpath = reverse(view_name, urlconf=self, args=args or [], kwargs=kwargs or {})
                
                try:
                        subpath = reverse(view_name, urlconf=self, args=args or [], kwargs=kwargs or {})
-               except NoReverseMatch:
-                       raise ViewCanNotProvideSubpath
+               except NoReverseMatch, e:
+                       raise ViewCanNotProvideSubpath(e.message)
                
                if node is not None:
                        return node.construct_url(subpath)
                
                if node is not None:
                        return node.construct_url(subpath)
@@ -219,7 +219,7 @@ class TargetURLModel(models.Model):
                
                try:
                        self.get_target_url()
                
                try:
                        self.get_target_url()
-               except NoReverseMatch, e:
+               except (NoReverseMatch, ViewCanNotProvideSubpath), e:
                        raise ValidationError(e.message)
                
                super(TargetURLModel, self).clean()
                        raise ValidationError(e.message)
                
                super(TargetURLModel, self).clean()
@@ -234,7 +234,7 @@ class TargetURLModel(models.Model):
                node = self.target_node
                if node is not None and node.accepts_subpath and self.url_or_subpath:
                        if self.reversing_parameters is not None:
                node = self.target_node
                if node is not None and node.accepts_subpath and self.url_or_subpath:
                        if self.reversing_parameters is not None:
-                               view_name, args, kwargs = self.get_reversing_params()
+                               view_name, args, kwargs = self.get_reverse_params()
                                subpath = node.view.reverse(view_name, args=args, kwargs=kwargs)
                        else:
                                subpath = self.url_or_subpath
                                subpath = node.view.reverse(view_name, args=args, kwargs=kwargs)
                        else:
                                subpath = self.url_or_subpath
@@ -245,7 +245,7 @@ class TargetURLModel(models.Model):
                        return node.get_absolute_url()
                else:
                        if self.reversing_parameters is not None:
                        return node.get_absolute_url()
                else:
                        if self.reversing_parameters is not None:
-                               view_name, args, kwargs = self.get_reversing_params()
+                               view_name, args, kwargs = self.get_reverse_params()
                                return reverse(view_name, args=args, kwargs=kwargs)
                        return self.url_or_subpath
        target_url = property(get_target_url)
                                return reverse(view_name, args=args, kwargs=kwargs)
                        return self.url_or_subpath
        target_url = property(get_target_url)