当前位置: 首页>>代码示例>>Python>>正文


Python DataGrid.__init__方法代码示例

本文整理汇总了Python中djblets.datagrid.grids.DataGrid.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python DataGrid.__init__方法的具体用法?Python DataGrid.__init__怎么用?Python DataGrid.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在djblets.datagrid.grids.DataGrid的用法示例。


在下文中一共展示了DataGrid.__init__方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from djblets.datagrid.grids import DataGrid [as 别名]
# 或者: from djblets.datagrid.grids.DataGrid import __init__ [as 别名]
 def __init__(self, request,
              queryset=Matos.objects.all(),
              title="Tout le matos"):
     DataGrid.__init__(self, request, queryset, title)
     self.show_disabled = False
     self.default_sort = ["titre"]
     self.default_columns = ["titre", "prix", "date_achat", "categorie"]
开发者ID:cattias,项目名称:cannesalair,代码行数:9,代码来源:datagrids.py

示例2: __init__

# 需要导入模块: from djblets.datagrid.grids import DataGrid [as 别名]
# 或者: from djblets.datagrid.grids.DataGrid import __init__ [as 别名]
    def __init__(self, *args, **kwargs):
        self.local_site = kwargs.pop('local_site', None)

        if self.local_site:
            review_id_field = 'local_id'
        else:
            review_id_field = 'pk'

        self.review_id = Column(_("Review ID"),
                                field_name=review_id_field,
                                shrink=True, sortable=True, link=True)

        DataGrid.__init__(self, *args, **kwargs)
        self.listview_template = 'reviews/review_request_listview.html'
        self.profile_sort_field = 'sort_review_request_columns'
        self.profile_columns_field = 'review_request_columns'
        self.show_submitted = True
        self.submitter_url_name = "user"
        self.default_sort = ["-last_updated"]
        self.default_columns = [
            "star", "summary", "submitter", "time_added", "last_updated_since"
        ]

        # Add local timezone info to the columns
        user = self.request.user
        if user.is_authenticated():
            self.timezone = pytz.timezone(user.get_profile().timezone)
            self.time_added.timezone = self.timezone
            self.last_updated.timezone = self.timezone
            self.diff_updated.timezone = self.timezone
开发者ID:JustinTulloss,项目名称:reviewboard,代码行数:32,代码来源:datagrids.py

示例3: __init__

# 需要导入模块: from djblets.datagrid.grids import DataGrid [as 别名]
# 或者: from djblets.datagrid.grids.DataGrid import __init__ [as 别名]
 def __init__(self, request, title=_("All groups"), *args, **kwargs):
     DataGrid.__init__(self, request, queryset=Group.objects.all(),
                       title=title, *args, **kwargs)
     self.profile_sort_field = 'sort_group_columns'
     self.profile_columns_field = 'group_columns'
     self.default_sort = ["name"]
     self.default_columns = [
         "star", "name", "displayname", "pending_count"
     ]
开发者ID:obvio171,项目名称:reviewboard,代码行数:11,代码来源:datagrids.py

示例4: __init__

# 需要导入模块: from djblets.datagrid.grids import DataGrid [as 别名]
# 或者: from djblets.datagrid.grids.DataGrid import __init__ [as 别名]
    def __init__(self, request, title=_("All groups"), *args, **kwargs):
        local_site = kwargs.pop("local_site", None)
        queryset = Group.objects.accessible(request.user, local_site=local_site)

        DataGrid.__init__(self, request, queryset=queryset, title=title, *args, **kwargs)
        self.profile_sort_field = "sort_group_columns"
        self.profile_columns_field = "group_columns"
        self.default_sort = ["name"]
        self.default_columns = ["star", "name", "displayname", "pending_count"]
开发者ID:emou,项目名称:reviewboard,代码行数:11,代码来源:datagrids.py

示例5: __init__

# 需要导入模块: from djblets.datagrid.grids import DataGrid [as 别名]
# 或者: from djblets.datagrid.grids.DataGrid import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     self.local_site = kwargs.pop("local_site", None)
     DataGrid.__init__(self, *args, **kwargs)
     self.listview_template = "reviews/review_request_listview.html"
     self.profile_sort_field = "sort_review_request_columns"
     self.profile_columns_field = "review_request_columns"
     self.show_submitted = True
     self.submitter_url_name = "user"
     self.default_sort = ["-last_updated"]
     self.default_columns = ["star", "summary", "submitter", "time_added", "last_updated_since"]
开发者ID:philipphenkel,项目名称:post-reviewboard,代码行数:12,代码来源:datagrids.py

示例6: __init__

# 需要导入模块: from djblets.datagrid.grids import DataGrid [as 别名]
# 或者: from djblets.datagrid.grids.DataGrid import __init__ [as 别名]
    def __init__(self, request):
        sel_common = "SELECT COUNT(*) FROM plug_uris_uri WHERE"
        sql_table_join = "AND uri_source=plug_uris_urisource.id"

        sql_img_ok = "%s status=%i %s" % (sel_common, models.URIS_COMPLETED, sql_table_join)
        sql_img_waiting = "%s status=%i AND item_type=%i AND err_code=%i %s" % (
            sel_common, models.URIS_CREATED, models.URIT_OBJECT, models.URIE_NO_ERROR, sql_table_join)
        sql_img_bad = "%s err_code > %i %s" % (sel_common, models.URIE_NO_ERROR, sql_table_join)

        sql = "SELECT task_eta FROM process_monitor_processmonitoring where pid=plug_uris_urisource.pid"
        DataGrid.__init__(self, request,
                          models.UriSource.objects.extra(select={
                              'imgs_ok':sql_img_ok,
                              #'imgs_bad': sql_img_bad,
                              'imgs_waiting':sql_img_waiting,
                              #'eta':sql,
                              }), "Uri sources")
        #DataGrid.__init__(self, request, User.objects.filter(is_active=True), "Users")
        self.default_sort = [COL_NAME]
        self.default_columns = [COL_NAME, COL_WAITING, COL_OK, COL_BAD]
开发者ID:europeana,项目名称:tools,代码行数:22,代码来源:datagrids.py

示例7: __init__

# 需要导入模块: from djblets.datagrid.grids import DataGrid [as 别名]
# 或者: from djblets.datagrid.grids.DataGrid import __init__ [as 别名]
    def __init__(self, *args, **kwargs):
        self.local_site = kwargs.pop('local_site', None)

        if self.local_site:
            review_id_field = 'local_id'
        else:
            review_id_field = 'pk'

        self.review_id = Column(_("Review ID"),
                                field_name=review_id_field,
                                shrink=True, sortable=True, link=True)

        DataGrid.__init__(self, *args, **kwargs)
        self.listview_template = 'reviews/review_request_listview.html'
        self.profile_sort_field = 'sort_review_request_columns'
        self.profile_columns_field = 'review_request_columns'
        self.show_submitted = True
        self.submitter_url_name = "user"
        self.default_sort = ["-last_updated"]
        self.default_columns = [
            "star", "summary", "submitter", "time_added", "last_updated_since"
        ]
开发者ID:aineko,项目名称:reviewboard,代码行数:24,代码来源:datagrids.py

示例8: __init__

# 需要导入模块: from djblets.datagrid.grids import DataGrid [as 别名]
# 或者: from djblets.datagrid.grids.DataGrid import __init__ [as 别名]
 def __init__(self, request):
     DataGrid.__init__(self, request, Group.objects.all(), "All Groups")
     self.default_sort = []
     self.default_columns = ['objid', 'name']
开发者ID:Harikanrh,项目名称:djblets,代码行数:6,代码来源:tests.py


注:本文中的djblets.datagrid.grids.DataGrid.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。