Ticket #3410: docpatch.diff

File docpatch.diff, 1.5 KB (added by mirrorballu2@…, 9 years ago)

A patch for doc.py

  • doc.py

     
    168168            model = m
    169169            break
    170170    if model is None:
    171         raise Http404, _("Model %r not found in app %r") % (model_name, app_label)
     171        raise Http404, _("Model %(model_name)r not found in app %(app_label)r") % {'model_name': model_name, 'app_label': app_label}
    172172
    173173    opts = model._meta
    174174
     
    180180        if isinstance(field, models.ForeignKey):
    181181            data_type = related_object_name = field.rel.to.__name__
    182182            app_label = field.rel.to._meta.app_label
    183             verbose = utils.parse_rst((_("the related `%s.%s` object")  % (app_label, data_type)), 'model', _('model:') + data_type)
     183            verbose = utils.parse_rst((_("the related `%(app_label)s.%(data_type)s` object")  % {'app_label': app_label, 'data_type': data_type})), 'model', _('model:') + data_type)
    184184        else:
    185185            data_type = get_readable_field_data_type(field)
    186186            verbose = field.verbose_name
     
    211211
    212212    # Gather related objects
    213213    for rel in opts.get_all_related_objects():
    214         verbose = _("related `%s.%s` objects") % (rel.opts.app_label, rel.opts.object_name)
     214        verbose = _("related `%(app_label)s.%(object_name)s` objects") % {'app_label': rel.opts.app_label, 'object_name': rel.opts.object_name}
    215215        accessor = rel.get_accessor_name()
    216216        fields.append({
    217217            'name'      : "%s.all" % accessor,
Back to Top