character-fandom tag association system
Link character tags to fandom tags via fandom_id FK with auto-apply behavior. Adding character:Saber (Fate) auto-creates fandom:Fate and applies it to the image. Renaming a fandom cascades to all linked characters. Includes set-fandom endpoint for retroactive association and fandom selector dropdown in the tag editor UI. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -43,6 +43,8 @@ class Tag(db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
name = db.Column(db.String(255), unique=True, nullable=False)
|
||||
kind = db.Column(db.String(64), nullable=True)
|
||||
fandom_id = db.Column(db.Integer, db.ForeignKey("tag.id", ondelete="SET NULL"), nullable=True)
|
||||
fandom = db.relationship("Tag", remote_side="Tag.id", foreign_keys=[fandom_id])
|
||||
images = db.relationship(
|
||||
"ImageRecord",
|
||||
secondary=image_tags,
|
||||
|
||||
Reference in New Issue
Block a user