Esempio n. 1
0
 def get_display_url(cls, obj):
     """Returns the url to show as a link on the object display when selected.
     
     The default value is the Admin URL for this object.
     
     You can also inform an empty string to set it as disabled."""
     return get_admin_url(obj)
Esempio n. 2
0
 def get_display_url(cls, obj):
     """Returns the url to show as a link on the object display when selected.
     
     The default value is the Admin URL for this object.
     
     You can also inform an empty string to set it as disabled."""
     return get_admin_url(obj)
Esempio n. 3
0
    def get_display_url(self, value):
        global registered_models

        try:
            driver = registered_models[self.model]
        except KeyError:
            return ""

        try:
            obj = self.model._default_manager.get(**{self.related_field: value})

            return get_admin_url(obj)
        except self.model.DoesNotExist:
            return ""
Esempio n. 4
0
    def get_display_url(self, value):
        global registered_models

        try:
            driver = registered_models[self.model]
        except KeyError:
            return ''

        try:
            obj = self.model._default_manager.get(
                **{self.related_field: value})

            return get_admin_url(obj)
        except self.model.DoesNotExist:
            return ''
Esempio n. 5
0
    def get_display_url(self, value):
        global registered_models
        
        #try:
        #    driver = registered_models[self.model]
        #except KeyError:
        #    return ''

        if not self.model:
            return ''

        try:
            obj = self.model._default_manager.get(**{self.related_field: value})

            return get_admin_url(obj)
        except ObjectDoesNotExist:
            return ''
Esempio n. 6
0
def admin_url(obj):
    return get_admin_url(obj)
Esempio n. 7
0
def admin_url(obj):
    return get_admin_url(obj)