templates and controllers

Thomas De Schampheleire patrickdepinguin at gmail.com
Fri Feb 13 10:11:14 EST 2015


Hi,

I have a question about how one should handle the split between
controllers and templates. Let's take one particular example: the
difference between the list of pull requests of a particular
repository (/pull-request) and the list of 'my pull requests'.

For 'all pull requests' of a repo, the actual data is rendered from
the controller and placed in a variable c.pullrequest_data, which is
expanded from the template. The data is loaded statically (no AJAX)
and paged at the controller side.

For 'my pull requests', the actual data is fetched dynamically, via
AJAX, and no paging is performed.

Since I want to line up these two lists of very similar data (at a
minimum the way it is displayed), I would like to know what you
consider the best approach wrt this template/controller split.

Other feedback on this topic is also welcome.


(Side questions:
- what is the 'c' for in c.pullrequest_data, 'controller'?
- what is the difference between 'c' and 'h' ?
)


Thanks,
Thomas


More information about the kallithea-general mailing list