datatracker/ietf/iesg/resources.py
Jennifer Richards 372891194e
feat: Move IESG agenda items from filesystem to DB (#5366)
* feat: Add TelechatAgendaContent model and related support

* feat: Add UI for managing TelechatAgendaContents

* refactor: Rename _view view to _manage

* feat: Add a view to dump the TelechatAgendaContent as text/plain

* refactor: Point agenda_data() helpers at content in the DB

* refactor: Replace references to settings URLs/paths with new plumbing

* chore: Remove now-obsolete settings from settings.py

* feat: Link to telechat_agenda_content_manage view from iesg agenda

* fix: Use correct view name

* feat: Link from agenda content management page to IESG agenda view

* chore: Create resources

* chore: Add new names to names.json

* chore: Renumber migration after rebase

* chore: Remove unused import

* fix: Clean up partially removed code

* chore: Add admin model for TelechatAgendaContent

* chore: Simplify __str__ method for TelechatAgendaContent

* test: Add TelechatAgendaContentFactory

* test: Test the fill_in_agenda_administrivia() function

* test: Test that agenda contains action_items content

* test: Test that sensitive agenda links are restricted by role

* test: Test the telechat_agenda_content_view view

* test: Add test of telechat_agenda_content_edit view

* fix: Add type attribute to button to satisfy html validator

* test: Filter TelechatAgendaSectionName to used=True for tests

* test: More thoroughly test for likely(ish) permission errors

* fix: Fix typo in "tablist" role

* test: Test telechat_agenda_content_manage view

* style: Put back newlines at EOF

* chore: Add admin for TelechatAgendaSectionName

* chore: Renumber migrations

* fix: Depend on the correct migration

Forgot to update the number, but was also depending on the wrong
migration.
2023-04-23 18:05:58 -05:00

79 lines
2.3 KiB
Python

# Copyright The IETF Trust 2014-2019, All Rights Reserved
# -*- coding: utf-8 -*-
# Autogenerated by the mkresources management command 2014-11-13 23:53
from ietf.api import ModelResource, ToOneField
from tastypie.constants import ALL, ALL_WITH_RELATIONS
from tastypie.cache import SimpleCache
from ietf import api
from ietf.iesg.models import TelechatDate, Telechat, TelechatAgendaItem, TelechatAgendaContent
class TelechatDateResource(ModelResource):
class Meta:
cache = SimpleCache()
queryset = TelechatDate.objects.all()
serializer = api.Serializer()
#resource_name = 'telechatdate'
ordering = ['id', ]
filtering = {
"id": ALL,
"date": ALL,
}
api.iesg.register(TelechatDateResource())
class TelechatResource(ModelResource):
class Meta:
cache = SimpleCache()
queryset = Telechat.objects.all()
serializer = api.Serializer()
#resource_name = 'telechat'
ordering = ['tlechat_id', ]
filtering = {
"telechat_id": ALL,
"telechat_date": ALL,
"minute_approved": ALL,
"wg_news_txt": ALL,
"iab_news_txt": ALL,
"management_issue": ALL,
"frozen": ALL,
"mi_frozen": ALL,
}
api.iesg.register(TelechatResource())
class TelechatAgendaItemResource(ModelResource):
class Meta:
cache = SimpleCache()
queryset = TelechatAgendaItem.objects.all()
serializer = api.Serializer()
#resource_name = 'telechatagendaitem'
ordering = ['id', ]
filtering = {
"id": ALL,
"text": ALL,
"type": ALL,
"title": ALL,
}
api.iesg.register(TelechatAgendaItemResource())
from ietf.name.resources import TelechatAgendaSectionNameResource
class TelechatAgendaContentResource(ModelResource):
section = ToOneField(TelechatAgendaSectionNameResource, 'section')
class Meta:
queryset = TelechatAgendaContent.objects.none()
serializer = api.Serializer()
cache = SimpleCache()
#resource_name = 'telechatagendacontent'
ordering = ['id', ]
filtering = {
"id": ALL,
"text": ALL,
"section": ALL_WITH_RELATIONS,
}
api.iesg.register(TelechatAgendaContentResource())