praekelt/jmbo — pull request #28 by jbeyers (2014-12-08 07:17:18+00:00)
Title: Allow slugs to be unique only per site

Relaxed the requirement to have unique slugs, changing it to a requirement that slugs be unique per site. This is very constrained: We only allow the user to make the slug the same as another of the same ModelBase-based content type. To do this, we added a selection field in the 'advanced' options on the admin form, allowing the user to pick another object of the same type. Validation depends on the admin form context: If you pick an item, the error message shows up at the picker, but if you set the sites that an item with non-unique slug is active on, the error will show up on the site selector.

Default behaviour is still to have the slug being autogenerated and unique, so none of that code was touched. No manual editing of the slug is allowed at all.

The PermittedManager is also adjusted to only ever show objects per site. Current jmbo-based modules were checked for the use of the correct manager when locating an object by slug.