divio/django-cms — pull request #2123 by stefanocrosta (2013-08-01 01:53:32+00:00)
Title: Moved logic for determining the highest priority link into model itself

Currently the logic to determine the link for a cms.plugins.link.models.Link is in the render method.

Having it into the model instead allows to access the "link" from the Link instance directly.

The need comes from a custom plugin that has a foreign key for Link; this allows to directly to {{ link_instance.link }} in a template - otherwise impossible.

Also removed some whitespaces for PEP-8 (but left a typo as originally in comment)