From d6eea439a3da7d1e3e545586a5caa4c29c2695b8 Mon Sep 17 00:00:00 2001 From: Stephen Burrows Date: Fri, 20 May 2011 17:34:08 -0400 Subject: [PATCH] Hacked around the descriptor issues, since there were only three. --- docs/conf.py | 7 +++++++ philo/contrib/sobol/models.py | 2 +- philo/models/nodes.py | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index b4b1e16..c888d0e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -24,6 +24,13 @@ os.environ['DJANGO_SETTINGS_MODULE'] = 'dummy-settings' # Import loader so that loader_tags will be correctly added to builtins. Weird import situations... this is necessary for doc build to work. from django.template import loader +# HACK to override descriptors that would cause AttributeErrors to be raised otherwise (which would keep them from being documented.) +from philo.contrib.sobol.models import SearchView +SearchView.searches = 5 +from philo.models.nodes import TargetURLModel, File +TargetURLModel.reversing_parameters = 5 +File.file = 5 + # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. diff --git a/philo/contrib/sobol/models.py b/philo/contrib/sobol/models.py index fb31dce..7687c09 100644 --- a/philo/contrib/sobol/models.py +++ b/philo/contrib/sobol/models.py @@ -175,7 +175,7 @@ class SearchView(MultiView): """Handles a view for the results of a search, anonymously tracks the selections made by end users, and provides an AJAX API for asynchronous search result loading. This can be particularly useful if some searches are slow.""" #: :class:`ForeignKey` to a :class:`.Page` which will be used to render the search results. results_page = models.ForeignKey(Page, related_name='search_results_related') - #: A class:`.SlugMultipleChoiceField` whose choices are the contents of the :class:`.SearchRegistry` + #: A :class:`.SlugMultipleChoiceField` whose choices are the contents of the :class:`.SearchRegistry` searches = RegistryChoiceField(choices=registry.iterchoices()) #: A :class:`BooleanField` which controls whether or not the AJAX API is enabled. #: diff --git a/philo/models/nodes.py b/philo/models/nodes.py index 58adb6e..87ccb40 100644 --- a/philo/models/nodes.py +++ b/philo/models/nodes.py @@ -291,7 +291,7 @@ class MultiView(View): class TargetURLModel(models.Model): """An abstract parent class for models which deal in targeting a url.""" - #: An optional :class:`ForeignKey` to a :class:`Node`. If provided, that node will be used as the basis for the redirect. + #: An optional :class:`ForeignKey` to a :class:`.Node`. If provided, that node will be used as the basis for the redirect. target_node = models.ForeignKey(Node, blank=True, null=True, related_name="%(app_label)s_%(class)s_related") #: A :class:`CharField` which may contain an absolute or relative URL, or the name of a node's subpath. url_or_subpath = models.CharField(max_length=200, blank=True, help_text="Point to this url or, if a node is defined and accepts subpaths, this subpath of the node.") -- 2.20.1