Exemple #1
0
    def handle(self, *args, **options):
        view = load_obj(args[0])
        model = self._get_model(view)

        columns = self._get_columns(model)

        grid = ExtGrid(columns=columns)

        grid.params['store']['model'] = model.__name__
        grid.params['store']['proxy']['directFn'] = "%s.%s" % (view.__module__.replace(".views",""), view.__name__)
        #grid.params['title'] =

        title = model._meta.verbose_name_plural.capitalize() if hasattr(model._meta, "verbose_name_plural") else ""

        print unicode(ExtWindow(as_class=True, name=view.__name__+"Window", items=grid, title=title)).encode("utf-8") +\
            "\n\n" + unicode(convert(model)).encode("utf-8")
Exemple #2
0
    def handle(self, *args, **options):
        view = load_obj(args[0])
        model = view.model
        tpl = self._create_template(model)

        dataview = DataView(tpl=tpl)
        title = ""

        dataview.params['store']['model'] = model.__name__
        dataview.params['store']['proxy']['directFn'] = "%s.%s" % (view.__module__.replace(".views",""), view.__name__)

        print (
            unicode(ExtWindow(as_class=True, name=view.__name__+"Window", items=dataview, title=title)) +
            "\n\n" +
            unicode(convert(model))
        ).encode("utf-8")
Exemple #3
0
 def handle(self, *args, **options):
     instance = load_obj(args[0])
     print convert(instance)