i just wanna have a similar logentry like history in admin page in my own page instead of admin pages. and now it just shows ‘type object ‘object’ has no attribute ‘_meta’’.
view.py
res = dict()
res['objects'] = LogEntry.objects.all()
LogEntry.objects.log_action(
user_id=request.user.pk,
content_type_id=get_content_type_for_model(object).pk,
object_id=object.pk,
object_repr=object.__repr__(),
action_flag=CHANGE,
change_message=''oooops"
)
return render(request, 'homePage.html', {"objects": object})
html
<tbody>
{% for i in objects %}
<tr>
<td>{{ i.action_time }}</td>
<td>{{ i.object_repr }}</td>
<td>{{ i.object_id }}</td>
<td>{{ i.get_action_flag_display }}</td>
<td>{{ i.user }}</td>
<td>{{ i.change_message }}</td>
</tr> {% endfor %}
</tbody>