Skip to content
This repository has been archived by the owner on Aug 12, 2020. It is now read-only.

Please package #13

Open
elijahr opened this issue Jun 29, 2012 · 2 comments
Open

Please package #13

elijahr opened this issue Jun 29, 2012 · 2 comments

Comments

@elijahr
Copy link

elijahr commented Jun 29, 2012

Please package this app with a setup.py script. Would be nice if it was on pypi as well. Thanks!

@sigurdga
Copy link
Owner

@elijahr Would that be useful? Would you use the django app inside without changing it? I would add a ton of extra fields before using it.

@Allan-Nava
Copy link

Is possible integrate django jquery file upload without this:

class PictureCreateView(CreateView):
    model = Picture
    fields = "__all__"

    def form_valid(self, form):
        self.object = form.save()
        files = [serialize(self.object)]
        data = {'files': files}
        response = JSONResponse(data, mimetype=response_mimetype(self.request))
        response['Content-Disposition'] = 'inline; filename=files.json'
        return response

https://github.com/sigurdga/django-jquery-file-upload/blob/master/fileupload/views.py#L15

I'm trying to use this:

@login_required
@ajax_required
def upload_files(request):
    fdata       = deserialized_query_dict(request.POST)
    print(fdata)
    upload_type = fdata['upload_type']
    if upload_type == 'img':
        files = [serialize_file_upload(ImageContent(), 'content_url')]
    elif upload_type:
        files = [serialize_file_upload(VideoContent(), 'content_url')]
    
    print(files)
    data = {'files': files}
    print(data)
    response = JSONResponse_FileUpload(data, mimetype=response_mimetype(request))
    response['Content-Disposition'] = 'inline; filename=files.json'
    return response
    #

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants