Application reference¶
Roles and permissions¶
REST framework permission helpers for role-based access.
- class accounts.permissions.IsEditorOrJournalist[source]¶
Bases:
BasePermissionAllow access to editors and journalists, including superusers.
- class accounts.permissions.IsInternalAPIRequest[source]¶
Bases:
BasePermissionRestrict endpoint access to callers with the internal API key.
- class accounts.permissions.IsJournalist[source]¶
Bases:
BasePermissionAllow access only to journalists.
Approval services¶
Service helpers for article approval side effects.
- articles.services.approve_article(article, editor)[source]¶
Save approval, log it internally, and notify subscribers.
The approval is persisted before either integration runs. Integration errors propagate to the caller without reverting the approval.
- articles.services.article_subscribers(article)[source]¶
Return active readers subscribed to the author or publisher.
Data models¶
Database models for articles, newsletters, and approval logs.
- class articles.models.ApprovedArticleLog(*args, **kwargs)[source]¶
Bases:
ModelAn audit record for an approved article.
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- class articles.models.Article(*args, **kwargs)[source]¶
Bases:
ModelA journalist’s news article, optionally tied to a publisher.
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- class articles.models.Newsletter(*args, **kwargs)[source]¶
Bases:
ModelA curated newsletter containing approved articles.
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
Database models for publishers and affiliations.
Publisher workflows¶
Website views for creating and managing publishers.
- publications.views.can_manage_publisher(user, publisher)[source]¶
Return True if the user is an editor affiliated with the publisher.
Superusers may manage every publisher.
- publications.views.publisher_create_page(request)[source]¶
Let an editor create a publisher and join as an editor.
- publications.views.publisher_delete_page(request, pk)[source]¶
Delete a publisher unless articles still reference it.