americanhandelsociety / americanhandelsociety-members

0 stars 0 forks source link

As the Newsletter editor, I can see which members updated their profile (in the last 30 days) in the Admin dashboard #104

Closed reginafcompton closed 2 years ago

reginafcompton commented 2 years ago

As the Newsletter editor, I can see which members updated their profile (in the last 30 days) in the Admin dashboard

reginafcompton commented 2 years ago

@ecedmondson - since you've been involved with Django upgrade business at Bevy....would you like to do this more enjoyable issue? Minji asked for this functionality. She'd like an additional column in Users table in the admin view; this column should indicate (e.g., with a boolean....some kind of messaging.....an emoji....) that the user recently updated their profile.

I see a couple tasks:

  1. Add a last_updated/last_modified timestamp to our Member model. It inherits from Django's AbstractUser, which as far as I can tell does not have a last_modified timestamp: https://github.com/django/django/blob/7119f40c9881666b6f9b5cf7df09ee1d21cc8344/django/contrib/auth/models.py#L334 (...double check me...please)
  2. Add a property (on the admin class?) that calculates the return value for this column. A quick search of The Internet indicates we have a several options here.

Anywaaaayyyyyy....let me know if you'd like to chat. You probably have strong creative ideas for implementing this requirement.

ecedmondson commented 2 years ago

since you've been involved with Django upgrade business at Bevy....would you like to do this more enjoyable issue?

I don't mind doing the upgrade, but I agree this will be less tedious. I am happy to do this. Is there a specific timeline Minji has communicated to you?

Add a property (on the admin class?) that calculates the return value for this column. A quick search of The Internet indicates we have a several options here

I feel like I recently did something similar to this in one of the Django cookbooks I've been working through....but my memory fails me. I'll check the book again and see if I find anything actually relevant.

I have a question. The issue title says "flag" which frankly confuses me 1) given the description above and 2) probably some semantic overload with waffle flags. Can you help me understand what you meant there? c.f. @reginafcompton

reginafcompton commented 2 years ago

Is there a specific timeline Minji has communicated to you?

Nope. Whenever you have time should be fine.

I have a question . . .

I changed the Issue description. Sorry about "flag"! That's an obnoxious noun.

Honestly, we have complete freedom here. So, you can implement this user story however makes sense to you. (I also hope that makes this issue enjoyable.) My notes are just a starting point. I'm also happy to chat about it, too.

ecedmondson commented 2 years ago

Sounds good. I'll look back at the Django cookbook I mentioned, see if I can find anything relevant, report back here, and we can decide from there how to move forward.

c.f. @reginafcompton

ecedmondson commented 2 years ago

Hey @reginafcompton: question for ya...that's not really related to this issue, but came up while I was looking into this issue and has come up before

https://github.com/americanhandelsociety/americanhandelsociety-members/blob/85d196501d2db95450caf222546581af3de49f53/americanhandelsociety_app/models.py#L13

Do you read docs or source code when building off of Django?

ecedmondson commented 2 years ago

Another question - this one more relevant: approximately how many user accounts for ahs are there in prod?

reginafcompton commented 2 years ago

Do you read docs or source code when building off of Django?

Yes, if overwriting or extending something. Also yes, if the docs themselves do not answer my questions.

approximately how many user accounts for AHS are there in prod?

Currently, 42. But it should be a little over 100. Minji thinks it might be a learning curve issue, wherein old-time members are confused by the new site. (We'll likely discuss this at the upcoming AHS board meeting.)

ecedmondson commented 2 years ago

Yes, if overwriting or extending something. Also yes, if the docs themselves do not answer my questions.

I can't believe I made the rookie mistake of asking a software engineer a question with a disjunction and not specifying if I meant inclusive or exclusive.

ecedmondson commented 2 years ago

Gotta another question for ya @reginafcompton:

Is being able to filter by updated in the past month something that would be considered part of this?

I have most of this implemented, except the filter part, which might be a might tricky. Don't know. Haven't thought about it too much yet.

I'm asking in order to figure out if I need to think about it.

ecedmondson commented 2 years ago

I thought about it and this ^ ended up not being tricky at all. I'll try to have a PR up soon.

reginafcompton commented 2 years ago

Is being able to filter by updated in the past month something that would be considered part of this?

That's not necessary, since the numbers of users is so small. But it sounds like you found a solution! Yay! I'll look forward to seeing the PR. (I should be online doing AHS things for an hour or so tomorrow afternoon.)

ecedmondson commented 2 years ago

The answer popped into my head while gardening. ¯_(ツ)_/¯