Code

Opened 7 years ago

Closed 7 years ago

#3752 closed (duplicate)

permalink documentation invalid

Reported by: Collin Grady <cgrady@…> Owned by: jacob
Component: Documentation Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

In http://www.djangoproject.com/documentation/model_api/#the-permalink-decorator it lists permalink usage as:

from django.db.models import permalink

def get_absolute_url(self):
    return ('people.views.details', str(self.id))
get_absolute_url = permalink(get_absolute_url)

But that is invalid - it will try to split the string up using each character as a positional arg. It should be:

from django.db.models import permalink

def get_absolute_url(self):
    return ('people.views.details', (str(self.id),))
get_absolute_url = permalink(get_absolute_url)

Attachments (0)

Change History (1)

comment:1 Changed 7 years ago by mtredinnick

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #3540, which I'm going to fix this afternoon.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.