| 147 | | # |
| 148 | | # # callback is either a string like 'foo.views.news.stories.story_detail' |
| 149 | | # callback = "pylucid_plugins.%s.views.%s" % (self.plugin_name, self.method_name) |
| 150 | | # try: |
| 151 | | # callable = get_callable(callback) |
| 152 | | # except ImportError, err: |
| 153 | | # |
| 154 | | # |
| 155 | | # |
| 156 | | # |
| 157 | | # # Add info for pylucid_project.apps.pylucid.context_processors.pylucid |
| 158 | | # request.plugin_name = self.plugin_name |
| 159 | | # request.method_name = self.method_name |
| 160 | | # |
| 161 | | # try: |
| 162 | | # # call the plugin view method |
| 163 | | # response = callable(request, **self.method_kwargs) |
| 164 | | # except: |
| 165 | | # |
| 166 | | # |
| 167 | | # # FIXME: Witch error should we raised here? |
| 168 | | # if response==None: |
| 169 | | # return u"" |
| 170 | | # assert(isinstance(response, HttpResponse), "pylucid plugins must return a HttpResponse instance!") |
| 171 | | # assert(response.status_code == 200, "Response status code != 200 ???") |
| 172 | | # |
| 173 | | # return response.content |
| | 147 | |