Improve creation of custom JS views and models for config pages.

Review Request #5594 — Created March 10, 2014 and submitted

Information

Djblets
master
52205ea...

Reviewers

ConfigPagesView now allows for creating a custom models and views for
the configuration page, along with custom options/attributes. These will
be outputted in the template when setting up the page.

A new template tag, json_dumps_items, helps to output data without
messing around with more expensive and messy template-based loops.

Used a custom model for the ConfigPagesView subclass, and passed data to it
and the view.

Made use of the new template tag with empty and full payloads.

Description From Last Updated

Does it make sense to have a model without a view?

daviddavid

If there's no js_view_class, this will be an error.

daviddavid
david
  1. 
      
  2. Show all issues

    Does it make sense to have a model without a view?

    1. Unless the caller is trying to shoot themselves in the foot and overrides js_view_class to None, there's always a default view for these pages, which will use this model if available. The entire config experience will fail without that view.

      Same applies below.

  3. Show all issues

    If there's no js_view_class, this will be an error.

    1. Still, given that you've conditionalized the assignment of configView, I think you should conditionalize the use of it.

    2. Fair enough.

    3. Think I'll go the other way and unconditionalize the view. Users should notice a breakage there.

  4. 
      
chipx86
david
  1. Ship It!

  2. 
      
chipx86
Review request changed
Status:
Completed