>
>  I would suggest something like 50 or 100. Let me know what you think, and
> if I made any sense at all


But in this case, we might show something like "User X deleted 50 rows",
when really they deleted 1000. I don't think we'd want to show such an
inaccurate message.

If you want though, you could put together a proof-of-concept. Perhaps
others would also prefer your suggestion.

2. Yes that fits my use case quite well. I think adding just a couple more
> block elements will definitely do it.
>

Please open a ticket/PR

3. Thank you! Glad I could contribute in some way.
>

You can pick up the ticket and make the docs patch :)


On Tue, 15 Dec 2020 at 22:02, Muskan Vaswan <muskanvas...@gmail.com> wrote:

> 1. Agreeably this won’t be easy but I might have a way of doing this
> without having to make changes to the data model. We can leave the data
> model as it is but manipulate the context that we give to by changing the
> simple query (Line 16
> <https://github.com/django/django/blob/master/django/contrib/admin/templatetags/log.py>)
>  to
> something slightly more complex.
> Like maybe
>     #logs = LogEntry.objects.values('action_time', 'action_flag', 'user',
> 'content_type').distinct()
>             #for l in logs:
>             #   e =
> LogEntry.objects.filter(Q(action_time=l['action_time']) &&
> Q(action_time=l['action_flag']))
>             #   if e.count() > 1:
>             #        entry = Entry(l, e)
>             #        entries.append(entry)
>             #   else:
>             #       entries.append(e)
> Where Entry() is a class (but not model) having necessary elements of
> LogEntry which are used in the templates already. Note that this is the
> most basic draft just to give an idea of what I’m trying to say.
> About having 1000 rows, you're right I guess we will have to reach a
> consensus to put an upper limit to the number of rows that can be
> encapsulated into one if we do decide to do this. I would suggest something
> like 50 or 100. Let me know what you think, and if I made any sense at all.
> There might be a point that this whole thing becomes an overkill, but as
> long as we don’t do something too major, I think it’ll be pleasing.
>
> 2. Yes that fits my use case quite well. I think adding just a couple more
> block elements will definitely do it.
>
> 3. Thank you! Glad I could contribute in some way.
>
> Regards
> Muskan Vaswan
> On Wednesday, 16 December 2020 at 01:13:39 UTC+5:30 Adam Johnson wrote:
>
>> 1. When deleting or adding items in Bulk (especially deleting), The
>>> Recent Actions should show “Deleted 15 Items”
>>>
>>
>> This would be nice, but you've spotted the problem with querying the
>> LogEntry table. If a user deleted e.g. 1,000 items, we wouldn't want to
>> query for 1000 LogEntry objects only to accumulate them into a single row
>> for display. I'm not sure there's a neat solution without changing the data
>> model, and whether that would be worth it for most sites.
>>
>> 2. The way the default index template can be overwritten by the user by
>>> specifying admin.index_template, I think it might be possible to give such
>>> an option for singular components of the admin site. For example, the
>>> entire header (Line 30 to 62
>>> <https://github.com/django/django/blob/master/django/contrib/admin/templates/admin/base.html>)
>>> could be put inside a block and then use an
>>>
>>
>> When overriding the base admin template I don't change those attributes,
>> but instead add a template file admin/base_site.html in my project's
>> templates that starts with "{% extends "admin/base_site.html" %}" , like:
>> https://docs.djangoproject.com/en/3.1/howto/overriding-templates/#extending-an-overridden-template
>> . Does this not support your use case?
>>
>> If so, I think adding a few more {% block %} declarations would be fine.
>>
>> 3. Last and the least, The method for unregistering models form the admin
>>> site is not in the documentation.
>>>
>>
>> Thanks, this looks like an oversight. Several snippets in the docs
>> recommend using unregister(). I made a ticket:
>> https://code.djangoproject.com/ticket/32273#ticket
>>
>> On Tue, 15 Dec 2020 at 18:44, Muskan Vaswan <muskan...@gmail.com> wrote:
>>
>>> [image: WhatsApp Image 2020-12-15 at 10.55.37 PM.jpeg]
>>>
>>> On Wednesday, 16 December 2020 at 00:12:40 UTC+5:30 Muskan Vaswan wrote:
>>>
>>>> I have the following suggestions and issues with the Django site
>>>> administration:
>>>>
>>>> 1. When deleting or adding items in Bulk (especially deleting), The
>>>> Recent Actions should show “Deleted 15 Items” rather than every deleted
>>>> item singularly which just occupies space and doesn't make a lot of sense
>>>> and put bluntly is a waste of space. (ScreenShot attached). This could also
>>>> be in the form of a dropdown which on click would show us every single one
>>>> of the logs. Now I know this may not be a major change to the page but I do
>>>> think it would improve the quality of the admin page. Do tell me if you
>>>> agree or disagree
>>>> After looking at the code for this, I realized that this wouldn’t be as
>>>> easy it seems because (at least as far as I could understand) the context
>>>> picks the action history from the LogEntry Model and passes it into the
>>>> context. But a possible solution to this would be changing the query to
>>>> give changes made on the same timestamp and tag as a list of actions and
>>>> the final context could be the list of all such distinct timestamps.
>>>>
>>>>
>>>> 2. The way the default index template can be overwritten by the user by
>>>> specifying admin.index_template, I think it might be possible to give such
>>>> an option for singular components of the admin site. For example, the
>>>> entire header (Line 30 to 62
>>>> <https://github.com/django/django/blob/master/django/contrib/admin/templates/admin/base.html>)
>>>> could be put inside a block and then use an
>>>> *{% include header.html %}* which would contain the code for the
>>>> entire header. And we could make this file default and give the option to
>>>> overwrite this particular template. We ensure that the components hold
>>>> their designated positions and leave the rest up to the user. We could also
>>>> do this for other elements and components like the footer. I think this
>>>> would increase ease of customization. Please give your views regarding the
>>>> same.
>>>>
>>>> 3. Last and the least, The method for unregistering models form the
>>>> admin site is not in the documentation. I only found it existed while going
>>>> through the source code and on StackOverflow. Is there a reason for this or
>>>> is this a lack of documentation that needs to be fixed?
>>>>
>>>> Regards
>>>> Muskan Vaswan
>>>>
>>>> --
>>> 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-develop...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-developers/58cf1866-a505-4ced-8ca2-c3aa449f57a3n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-developers/58cf1866-a505-4ced-8ca2-c3aa449f57a3n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> --
>> Adam
>>
> --
> 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/e3b2cbcb-d36f-4df0-884e-1249283ef3ban%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/e3b2cbcb-d36f-4df0-884e-1249283ef3ban%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Adam

-- 
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/CAMyDDM3ON-bkGXs%2B7jNfdWKWxP_%2B6j8OWQVDQEx%2Be2QyP4SLCQ%40mail.gmail.com.

Reply via email to