These are chat archives for CharlesGust/django-imagr

18th
Nov 2014
Ben Friedland
@BFriedland
Nov 18 2014 01:13
That makes sense in hindsight... It sounds like the admin interface does not hash user passwords when you create users there, but Django's login code hashes whatever the user types in when they try to log in, and compares the hash against the stored password -- which, if entered into the login screen, will be hashed out to a long number... and then compared to the short, plaintext password that we entered on the admin page.
It'd basically look like:46gh2048f2442ghv97e22ee82048 != admin
I got sufficient functionality in for editing photos and albums -- I pushed it to my branch forms_bf_2, spread over several commits so they're smaller changes each.
I also added some links to the home page and photo page views to make testing easier.
Ben Friedland
@BFriedland
Nov 18 2014 01:44
I figured out how to make the album editing page have default values for the photos that are already in the album! It was simply putting 'photos': this_album.photos.all() into the initial data handed to the form.
        initial_data = {'title': this_album.title,
                        'description': this_album.description,
                        'published': this_album.published,
                        'cover': this_album.cover.pk,
                        'photos': this_album.photos.all()}

        this_album_edit_form = forms.EditAlbumForm(initial_data)
Ben Friedland
@BFriedland
Nov 18 2014 02:43
I finished the follow_page. It has a list of users you're following, an edit form for that list, and a list of users following you.
There's no way to view user profiles or anything like that right now, so it's only going to affect what pops up in the stream page; I also noticed there's no way to find a photo you posted without checking the stream page for it...
Ben Friedland
@BFriedland
Nov 18 2014 03:07
I decided to solve that last issue with a history_page, which was pretty straightforwards to write. It's like home_page but displays up to 20 photos and albums sorted by upload date. Lets you find photos you added even if you forgot to put them in an album.
It's all on forms_bf_2 if you want to check it out before tomorrow. Logging out for now.
Charles Gust
@CharlesGust
Nov 18 2014 04:45
thanks @BFriedland . WIll look at the branch tonight
Charles Gust
@CharlesGust
Nov 18 2014 06:12
Hi @BFriedland . I have a question. Our admin form for http://localhost:8000/admin/imagr_app/imagruser/add/ does not look the same as the form in the Django Tutorial. Do you happen to know what accounts for this difference? I realize this form has been customized by our app (ie, the route is in the app, and the navigation under "Django Administration" points to our Imagr_app. How does this admin form know it's fields?
Ben Friedland
@BFriedland
Nov 18 2014 16:57
http://localhost:8000/admin/imagr_app/imagruser/add/ seems to be displaying the ImagrUser model, which inherits from AbstractUser, in its base entirety. The admin.py file COULD customize it, but we haven't done that part of the Imagr project yet -- I think it's the assignment at https://canvas.instructure.com/courses/889197/assignments/3087101
The route paths through /admin, then Django's admin stuff adds /imagr_user/ on the URL because it's picking models out of the imagr_user/models.py file.