I'm also skeptical we need to support this use case. Certainly some users
prefer *shared* log messages, so all actions are shown regardless of which
interface was used.

Just to comment on the DB side: storing the same few names over and over in
such a column would be a waste of disk space. It would be better to have a
FK to an "admin site" model, though we'd also need to consider query
performance. The LogEntry table can get quite big in busy orgs.

There is also the question of what to use as the name (full import path?),
and how to retain it even as the admin site object is renamed or moved.


On Thu, Jan 26, 2023 at 2:48 PM Carlton Gibson <carlton.gib...@gmail.com>
wrote:

> Hey Jacob.
>
> I had in mind literally **just** adding the content-types so that the line
> in that render call would be:
>
>     # this could be via a proposed context["site_content_types"] or via a
> map from
>     # "available_apps"
>     site_content_types: [ContentType] = ...
>     entries = LogEntry.objects.filter(
>         user__pk=user_id,
>         content_type__in=site_content_types
>     )
>
> This I can sort of see: OK, folks use multiple AdminSites, and having
> non-registered models show up is a cause of uncertainty, plausibly, yes.
>
> You want more than that thought right? (I'm still not certain I've grasped
> exactly what use-case you have in mind.)
>
> Passing in a callable seems an extra step of complexity up.
> (IDK, maybe it's not, but I'm not seeing it, although I'm known to be slow
> at times.)
>
> It would be undocumented magic.
> I think I'd lean towards suggesting a custom template and tag in that
> case.
>
> (But maybe that's just me.)
>
> A diff of what you actually have in mind would likely help (to at least be
> clear).
>
>
> C.
>
>
>
> On Thu, 26 Jan 2023 at 15:26, Jacob Rief <jacob.r...@gmail.com> wrote:
>
>> Hi Carlton,
>> that proposal makes a lot of sense.
>>
>> This means that one could for instance add a custom function to that
>> context which, if set, would be called
>> by the AdminLogNode.render method and then overrides the
>> context[self.varname].
>> How would you name that extra context variable, maybe
>> "render_log_entries"?
>> Another approach would be to move the functionality of method render
>> into the class AdminSite. This would
>> allow Django implementers to override the way, log entries are rendered.
>>
>> This would be a minimalistic change to the existing code base but would
>> allow to change the rendering
>> of log entries in a much more flexible way.
>>
>> Shall I create a ticket and a proof of concept?
>>
>> – Jacob
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django developers (Contributions to Django itself)" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-developers+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-developers/e50bce39-d1dd-44b5-9fae-fc1bc8c9c864n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-developers/e50bce39-d1dd-44b5-9fae-fc1bc8c9c864n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CAJwKpyQqW6wLUCHFQiFvReF-67_Ker8XoFHhFDvg4tnkwFLd_w%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-developers/CAJwKpyQqW6wLUCHFQiFvReF-67_Ker8XoFHhFDvg4tnkwFLd_w%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM3bAmrgSRQgpK5mhRMDxUJ%2BZHX%2B3UcRPAh0DUWY_XhMOg%40mail.gmail.com.
  • Mul... Jacob Rief
    • ... Carlton Gibson
      • ... Jacob Rief
        • ... Carlton Gibson
          • ... Jacob Rief
            • ... Carlton Gibson
              • ... 'Adam Johnson' via Django developers (Contributions to Django itself)
                • ... Jacob Rief

Reply via email to