Code

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#16579 closed New feature (invalid)

An issue of migrate comments to databrowse.

Reported by: leopku <leo.ss.pku@…> Owned by: nobody
Component: contrib.databrowse Version: 1.3
Severity: Normal Keywords: databrowse, comments
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Steps to reproduce bugs.

  1. install databrowse and comments app.
  1. add models in your app.
  1. view the instance of your models using databrowse.
  1. copy object_detail.html template from databrowse template dir to {your_project_dir}/templates/databrowse/
  1. add a line after "</table>" in {your_project_dir}/templates/databrowse/object_detail.html

{% render_comment_list for object %}

  1. refresh databrowse detail page of one instance. A TemplateSyntaxError was throw out.

Caught AttributeError while rendering: 'EasyInstance' object has no attribute '_meta'

Attachments (0)

Change History (2)

comment:1 Changed 3 years ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

Indeed, this happens because databrowse hands a wrapper (EasyInstance) to the view, not the original object. Try this: {% render_comment_list for object.instance %}.

I'm not sure if this qualifies as a bug: databrowse's documentation doesn't describe the templates, and databrowse is intended as a plug'n'play tool, not as a basis for further development. Also, I don't know how we could "fix" this: EasyInstance is really a core component of databrowse.

For these reasons, I'm marking this ticket as invalid. However, if you have an idea to improve Django with regard to this problem, please reopen the ticket and describe it.

comment:2 Changed 3 years ago by leopku <leo.ss.pku@…>

Great, object.instance works!

Thanks a lot.

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.