Opened 3 years ago

Closed 3 years ago

#22428 closed Bug (duplicate)

Model docstring not parsed in model detail

Reported by: Axel Amigo Arnold Owned by: nobody
Component: contrib.admindocs Version: 1.6
Severity: Normal Keywords: helpers, models
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Using the same example that comes in the documentation, the documentation helpers are not working, but they do work in the views.

My models:

class Growth(models.Model):
        """
        A Growth model. It must only exist one in the database.
        References :model:`auth.User`.

        """

        last_follow_job = models.DateTimeField()

My views:

def twitter_login(request, context=Context({})):
        """
        Asks a user permissions for our twitter app.

        **Session**

        `oauth_token`
                Stores Twitter's oauth_token
                in the session.

        `oauth_token_secret`
                Stores Twitter's oauth_token_secret
                in the session.
                It uses :model:`growth.TwitterAccount`

        **Context**
        `RequestContext`

        """
        from twython import Twython
        t = Twython(settings.TWITTER_KEY,  settings.TWITTER_SECRET)
        auth_props = t.get_authentication_tokens(callback_url='http://www.derpaderp.com/twitter_callback/')
        request.session['oauth_token'] = auth_props['oauth_token']
        request.session['oauth_token_secret'] = auth_props['oauth_token_secret']
        return HttpResponseRedirect(auth_props['auth_url'])

Attachments (2)

22428 attachments.zip (11.0 KB) - added by Axel Amigo Arnold 3 years ago.
Screenshots
22428-1.diff (2.8 KB) - added by Claude Paroz 3 years ago.

Download all attachments as: .zip

Change History (7)

Changed 3 years ago by Axel Amigo Arnold

Attachment: 22428 attachments.zip added

Screenshots

comment:1 Changed 3 years ago by Axel Amigo Arnold

Type: UncategorizedBug

comment:2 Changed 3 years ago by Claude Paroz

Triage Stage: UnreviewedAccepted

When you say "are not working", it would help being a little more descriptive.
I suppose you meant that the docstring is not parsed for the model. Accepting on that base.

Changed 3 years ago by Claude Paroz

Attachment: 22428-1.diff added

comment:3 Changed 3 years ago by Claude Paroz

Has patch: set
Summary: Documentation helpers not working in modelsModel docstring not parsed in model detail

comment:4 in reply to:  2 Changed 3 years ago by Axel Amigo Arnold

Replying to claudep:

When you say "are not working", it would help being a little more descriptive.
I suppose you meant that the docstring is not parsed for the model. Accepting on that base.

That's exactly what I meant. Sorry for the lack of descriptiveness.

comment:5 Changed 3 years ago by Aymeric Augustin

Resolution: duplicate
Status: newclosed

Duplicate of #5405.

Note: See TracTickets for help on using tickets.
Back to Top