datatracker/ietf/mailinglists/resources.py
Lars Eggert 220be21998
chore: Use codespell to fix typos in code. (#4797)
* chore: Use codespell to fix typos in code.

Second part of replacement of #4651

@rjsparks, I probably need to revert some things here, and I also
still need to add that new migration - how do I do that?

* Revert migrations

* Migrate "Whitelisted" to "Allowlisted"

* TEST_COVERAGE_MASTER_FILE -> TEST_COVERAGE_MAIN_FILE

* Fix permissions

* Add suggestions from @jennifer-richards
2022-12-07 15:10:35 -06:00

65 lines
1.9 KiB
Python

# Copyright The IETF Trust 2016-2019, All Rights Reserved
# -*- coding: utf-8 -*-
# Autogenerated by the makeresources management command 2016-06-12 12:29 PDT
from ietf.api import ModelResource
from tastypie.fields import ToManyField # pyflakes:ignore
from tastypie.constants import ALL, ALL_WITH_RELATIONS # pyflakes:ignore
from tastypie.cache import SimpleCache
from ietf import api
from ietf.api import ToOneField # pyflakes:ignore
from ietf.mailinglists.models import Allowlisted, List, Subscribed
from ietf.person.resources import PersonResource
class AllowlistedResource(ModelResource):
by = ToOneField(PersonResource, 'by')
class Meta:
queryset = Allowlisted.objects.all()
serializer = api.Serializer()
cache = SimpleCache()
#resource_name = 'allowlisted'
ordering = ['id', ]
filtering = {
"id": ALL,
"time": ALL,
"email": ALL,
"by": ALL_WITH_RELATIONS,
}
api.mailinglists.register(AllowlistedResource())
class ListResource(ModelResource):
class Meta:
queryset = List.objects.all()
serializer = api.Serializer()
cache = SimpleCache()
#resource_name = 'list'
ordering = ['id', ]
filtering = {
"id": ALL,
"name": ALL,
"description": ALL,
"advertised": ALL,
}
api.mailinglists.register(ListResource())
class SubscribedResource(ModelResource):
lists = ToManyField(ListResource, 'lists', null=True)
class Meta:
queryset = Subscribed.objects.all()
serializer = api.Serializer()
cache = SimpleCache()
#resource_name = 'subscribed'
ordering = ['id', ]
filtering = {
"id": ALL,
"time": ALL,
"email": ALL,
"lists": ALL_WITH_RELATIONS,
}
api.mailinglists.register(SubscribedResource())