Project

General

Profile

Feature #585

Alternative Title Slug Support

Added by Luke Murphey about 11 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
03/25/2013
Due date:
% Done:

100%


Description

Add a table that allows alternative title slugs to be used for texts. This allows the title_slugs to be modified without breaking existing links.

aliases.xlsx - Table of aliases to be created (99 KB) Luke Murphey, 03/26/2013 04:28 AM


Subtasks

Task #586: Dereference work title slugs from shortcuts tableClosedLuke Murphey

Task #587: Adjust URL if a new URL is usedClosedLuke Murphey

History

#1 Updated by Luke Murphey about 11 years ago

  • Status changed from New to In Progress

#2 Updated by Luke Murphey about 11 years ago

#3 Updated by Luke Murphey about 11 years ago

I populated the table with existing aliases with the following code:

from reader.models import Work, WorkAlias

s = """78    orationes-1
462    speeches-1
509    regum-et-imperatorum-apophthegmata-1
511    apophthegmata-laconica-1
512    instituta-laconica-1
513    lacaenarum-apophthegmata-1
515    mulierum-virtutes-1
517    quaestiones-romanae-1
519    quaestiones-graecae-1
521    parallela-minora-1
523    de-fortuna-romanorum-1
525    de-alexandri-magni-fortuna-aut-virtute-1
527    de-gloria-atheniensium-1
677    histories-1""" 

items = s.split("\n")

for item in items:
    id, alias = item.split("\t")
    work = Work.objects.get(id=id)
    work_alias = WorkAlias(work=work, title_slug=alias)
    work_alias.save()

#4 Updated by Luke Murphey about 11 years ago

  • Status changed from In Progress to Closed

Also available in: Atom PDF