equal
deleted
inserted
replaced
199 if not getattr(self, 'title', None): |
199 if not getattr(self, 'title', None): |
200 return False |
200 return False |
201 return True |
201 return True |
202 |
202 |
203 def is_primary(self): |
203 def is_primary(self): |
204 return self.extra_kwargs.get('is_primary', self.__regid__ == 'primary') |
204 return self.cw_extra_kwargs.get('is_primary', self.__regid__ == 'primary') |
205 |
205 |
206 def url(self): |
206 def url(self): |
207 """return the url associated with this view. Should not be |
207 """return the url associated with this view. Should not be |
208 necessary for non linkable views, but a default implementation |
208 necessary for non linkable views, but a default implementation |
209 is provided anyway. |
209 is provided anyway. |
212 if rset is None: |
212 if rset is None: |
213 return self._cw.build_url('view', vid=self.__regid__) |
213 return self._cw.build_url('view', vid=self.__regid__) |
214 coltypes = rset.column_types(0) |
214 coltypes = rset.column_types(0) |
215 if len(coltypes) == 1: |
215 if len(coltypes) == 1: |
216 etype = iter(coltypes).next() |
216 etype = iter(coltypes).next() |
217 if not self._cw.schema.eschema(etype).final: |
217 if not self._cw.vreg.schema.eschema(etype).final: |
218 if len(rset) == 1: |
218 if len(rset) == 1: |
219 entity = rset.get_entity(0, 0) |
219 entity = rset.get_entity(0, 0) |
220 return entity.absolute_url(vid=self.__regid__) |
220 return entity.absolute_url(vid=self.__regid__) |
221 # don't want to generate /<etype> url if there is some restriction |
221 # don't want to generate /<etype> url if there is some restriction |
222 # on something else than the entity type |
222 # on something else than the entity type |