cloudlaunch icon indicating copy to clipboard operation
cloudlaunch copied to clipboard

Rename slug to id?

Open nuwang opened this issue 7 years ago • 3 comments

Some primary keys use slug and others use id, which makes writing client code difficult, since you have to know in advanced whether an object is using slug or id. Since it doesn't matter whether the pk is a slug or not as it's autogenerated from the name anyway, it seems better to rename everything to ID.

nuwang avatar Oct 24 '17 09:10 nuwang

One reason for going down the slug path may be readability of the URLs, if we care about that. The ID's typically result in shorter URLs but they do expose a bit more about the deployment so perhaps should be encoded... Having said that, I don't have a strong opinion one way or another.

afgane avatar Oct 24 '17 11:10 afgane

What I meant was that we keep using a slug, but rename slug->id. That way, we can still have friendly urls etc., but we can always refer to an object's id by id, rather than having to switch between slug and id. So application.slug becomes application.id, but remains a slug value.

nuwang avatar Oct 24 '17 11:10 nuwang

In light of https://github.com/galaxyproject/cloudlaunch/issues/159, renaming to id makes even more sense.

afgane avatar Jan 30 '19 00:01 afgane