domain tags
see: lavatech/servicesagreement#3 (closed), legal!2 (comment 156241870)
domain owners may not want to deal with nsfw content on their domains, and that's valid.
- it can't be fully automatic, so the idea is to delete nsfw files on non-nsfw domains
- maybe a better name than nsfw would be nice? LSA uses "adult content" but it sounds too formal, "lewd" sounds too informal, and "nsfw" (i'm being very pedantic) means all the tying with the "work" part of the word, and i'd rather not propagate it
cc @All @edensg @GlitchMasta47
proposal
db changes
- add
tags
table, withtag_id
andlabel
columns- label we found out
sexual
,admin_only
,official
,disabled
- label we found out
- add
domain_tags
table to link domains to tags - drop
domains.official
column -
dropreverted. see #125 (comment 309237090)domains.admin_only
column
api changes
-
GET /api/domains
:- remove
officialdomains
- keep
domains
, mapping ID to the domain string - add
domain_tags
, mapping ID to an array of tag IDs - add
tags
, mapping tag ID to tag label
- remove
-
GET /api/admin/domain/<id>
gets a newtags
field, containing an array of tag IDs -
PATCH /api/admin/domain/<id>
gets a newtags
field, containing an array of tag IDs (the tags are replaced instead of ) -
PUT /api/admin/domain/tag
to create a tag (also available under./manage.py addtag
) -
DELETE /api/admin/domain/tag/<id>
to delete a tag
migration changes
- we will need to allow python scripts as migrations.
- the main purpose is to allow non-destructive migration to domain tags
- migration 4 adds the tag tables
- migration 5 (a script) creates two tags (admin_only and official) and adds the specific tags to each domain depending of columns (unless someone knows a way to do this in full sql, do tell)
- migration 6 deletes the
admin_only
andofficial
columns - see !114 (merged) for the revert
Edited by luna