Removed method Album.add_photos. It has nothing to do with "add photos" and model in general. This method runs Photo.objects.upload_to_album and sends push notification. This job should be done by Controller not a model, especially Album in this case.
Removed PhotoManager.upload_request. All this method does is it creates a new PendingPhoto and ensures uniquenes of photo_id. It has nothing to do with Photo model and especially with its Manager. Just use PendingPhoto.objects.create(author=someone) instead.
Removed PhotoManager.upload_to_album. This functionality added as a method on PendingPhoto. But I think functionality of this method should be moved to the controller.
Here are some highlights:
Album.add_photos
. It has nothing to do with "add photos" and model in general. This method runsPhoto.objects.upload_to_album
and sends push notification. This job should be done by Controller not a model, especiallyAlbum
in this case.PhotoManager.upload_request
. All this method does is it creates a newPendingPhoto
and ensures uniquenes ofphoto_id
. It has nothing to do withPhoto
model and especially with itsManager
. Just usePendingPhoto.objects.create(author=someone)
instead.PhotoManager.upload_to_album
. This functionality added as a method onPendingPhoto
. But I think functionality of this method should be moved to the controller.