def get_upload_path(self, filename):
        ''' Override this in proxy subclass to customize upload path.
            Default upload path is
            :file:`/media/images/<user.id>/<filename>.<ext>`
            or :file:`/media/images/common/<filename>.<ext>` if user is not set.

            ``<filename>`` is returned by
            :meth:`~generic_images.models.AbstractAttachedImage.get_file_name`
            method. By default it is probable id of new image (it is
            predicted as it is unknown at this stage).
        '''
        user_folder = str(self.user.pk) if self.user else 'common'

        root, ext = os.path.splitext(filename)
        return os.path.join('media', 'images', user_folder,
                            self.get_file_name(filename) + ext)
def get_upload_path ( self , filename ) : user_folder = str ( self . user . pk ) if self . user else 'common' root , ext = os . path . splitext ( filename ) return os . path . join ( 'media' , 'images' , user_folder , self . get_file_name ( filename ) + ext )
Override this in proxy subclass to customize upload path.
            Default upload path is
            :file:`/media/images/<user.id>/<filename>.<ext>`
            or :file:`/media/images/common/<filename>.<ext>` if user is not set.

            ``<filename>`` is returned by
            :meth:`~generic_images.models.AbstractAttachedImage.get_file_name`
            method. By default it is probable id of new image (it is
            predicted as it is unknown at this stage).