Пример #1
0
class VLANGroupTable(BaseTable):
    pk = ToggleColumn()
    name = tables.Column(linkify=True)
    scope_type = ContentTypeColumn()
    scope = tables.Column(
        linkify=True,
        orderable=False
    )
    vlan_count = LinkedCountColumn(
        viewname='ipam:vlan_list',
        url_params={'group_id': 'pk'},
        verbose_name='VLANs'
    )
    tags = TagColumn(
        url_name='ipam:vlangroup_list'
    )
    actions = ButtonsColumn(
        model=VLANGroup,
        prepend_template=VLANGROUP_ADD_VLAN
    )

    class Meta(BaseTable.Meta):
        model = VLANGroup
        fields = (
            'pk', 'id', 'name', 'scope_type', 'scope', 'vlan_count', 'slug', 'description', 'tags', 'actions',
            'created', 'last_updated',
        )
        default_columns = ('pk', 'name', 'scope_type', 'scope', 'vlan_count', 'description', 'actions')
Пример #2
0
class ExportTemplateTable(BaseTable):
    pk = ToggleColumn()
    name = tables.Column(linkify=True)
    content_type = ContentTypeColumn()
    as_attachment = BooleanColumn()

    class Meta(BaseTable.Meta):
        model = ExportTemplate
        fields = (
            'pk',
            'id',
            'name',
            'content_type',
            'description',
            'mime_type',
            'file_extension',
            'as_attachment',
            'created',
            'last_updated',
        )
        default_columns = (
            'pk',
            'name',
            'content_type',
            'description',
            'mime_type',
            'file_extension',
            'as_attachment',
        )
Пример #3
0
class ObjectChangeTable(BaseTable):
    time = tables.DateTimeColumn(
        linkify=True,
        format=settings.SHORT_DATETIME_FORMAT
    )
    user_name = tables.Column(
        verbose_name='Username'
    )
    full_name = tables.TemplateColumn(
        template_code=OBJECTCHANGE_FULL_NAME,
        verbose_name='Full Name',
        orderable=False
    )
    action = ChoiceFieldColumn()
    changed_object_type = ContentTypeColumn(
        verbose_name='Type'
    )
    object_repr = tables.TemplateColumn(
        template_code=OBJECTCHANGE_OBJECT,
        verbose_name='Object'
    )
    request_id = tables.TemplateColumn(
        template_code=OBJECTCHANGE_REQUEST_ID,
        verbose_name='Request ID'
    )

    class Meta(BaseTable.Meta):
        model = ObjectChange
        fields = ('id', 'time', 'user_name', 'full_name', 'action', 'changed_object_type', 'object_repr', 'request_id')
Пример #4
0
class TaggedItemTable(BaseTable):
    content_type = ContentTypeColumn(verbose_name='Type')
    content_object = tables.Column(linkify=True,
                                   orderable=False,
                                   verbose_name='Object')

    class Meta(BaseTable.Meta):
        model = TaggedItem
        fields = ('content_type', 'content_object')
Пример #5
0
class JournalEntryTable(ObjectJournalTable):
    pk = ToggleColumn()
    assigned_object_type = ContentTypeColumn(verbose_name='Object type')
    assigned_object = tables.Column(linkify=True,
                                    orderable=False,
                                    verbose_name='Object')

    class Meta(BaseTable.Meta):
        model = JournalEntry
        fields = ('pk', 'created', 'created_by', 'assigned_object_type',
                  'assigned_object', 'kind', 'comments', 'actions')
Пример #6
0
class TaggedItemTable(BaseTable):
    id = tables.Column(
        verbose_name='ID',
        linkify=lambda record: record.content_object.get_absolute_url(),
        accessor='content_object__id')
    content_type = ContentTypeColumn(verbose_name='Type')
    content_object = tables.Column(linkify=True,
                                   orderable=False,
                                   verbose_name='Object')

    class Meta(BaseTable.Meta):
        model = TaggedItem
        fields = ('id', 'content_type', 'content_object')
Пример #7
0
class CustomLinkTable(BaseTable):
    pk = ToggleColumn()
    name = tables.Column(
        linkify=True
    )
    content_type = ContentTypeColumn()
    new_window = BooleanColumn()

    class Meta(BaseTable.Meta):
        model = CustomLink
        fields = (
            'pk', 'name', 'content_type', 'link_text', 'link_url', 'weight', 'group_name', 'button_class', 'new_window',
        )
        default_columns = ('pk', 'name', 'content_type', 'group_name', 'button_class', 'new_window')
Пример #8
0
class ContactAssignmentTable(BaseTable):
    pk = ToggleColumn()
    content_type = ContentTypeColumn(verbose_name='Object Type')
    object = tables.Column(linkify=True, orderable=False)
    contact = tables.Column(linkify=True)
    role = tables.Column(linkify=True)
    actions = ButtonsColumn(model=ContactAssignment,
                            buttons=('edit', 'delete'))

    class Meta(BaseTable.Meta):
        model = ContactAssignment
        fields = ('pk', 'content_type', 'object', 'contact', 'role',
                  'priority', 'actions')
        default_columns = ('pk', 'content_type', 'object', 'contact', 'role',
                           'priority', 'actions')