Beispiel #1
0
    def save(self, *args, **kwargs):
        need = super(NeedForm, self).save(*args, **kwargs)
        UploadedFile.bind_files(
            self.cleaned_data.get('files', '').split('|'), need)

        videos = json.loads(self.cleaned_data.get('videos', ''))
        Video.save_videos(videos, need)

        # Add to project if a project id was given.
        project_id = self.cleaned_data.get('project_id', None)
        if project_id:
            project = get_object_or_None(Project, pk=int(project_id))
            if project:
                project.save_related_object(need, self.user)

        return need
    def save(self, *args, **kwargs):
        resource = super(FormResource, self).save(*args, **kwargs)
        UploadedFile.bind_files(
            self.cleaned_data.get('files', '').split('|'), resource)

        videos = json.loads(self.cleaned_data.get('videos', ''))
        Video.save_videos(videos, resource)

        # Add to project if a project id was given.
        project_id = self.cleaned_data.get('project_id', None)
        if project_id:
            project = get_object_or_None(Project, pk=int(project_id))
            if project:
                project.save_related_object(resource, self.user)

        return resource
    def save(self, *args, **kwargs):
        comm = super(CommunityForm, self).save(*args, **kwargs)
        UploadedFile.bind_files(
            self.cleaned_data.get('files', '').split('|'), comm
        )

        videos = json.loads(self.cleaned_data.get('videos', ''))
        Video.save_videos(videos, comm)

        # Add the community to project if a project id was given.
        project_id = self.cleaned_data.get('project_id', None)
        if project_id:
            project = get_object_or_None(Project, pk=int(project_id))
            if project:
                project.save_related_object(comm, self.user)

        return comm
Beispiel #4
0
 def save(self, *args, **kwargs):
     need = super(NeedForm, self).save(*args, **kwargs)
     UploadedFile.bind_files(
         self.cleaned_data.get('files', '').split('|'), need)
     return need
Beispiel #5
0
 def save(self, *args, **kwargs):
     profile = super(FormProfile, self).save(*args, **kwargs)
     UploadedFile.bind_files(
         self.cleaned_data.get('photo', '').split('|'), profile)
     return profile
Beispiel #6
0
 def save(self, *args, **kwargs):
     profile = super(FormProfile, self).save(*args, **kwargs)
     UploadedFile.bind_files(
         self.cleaned_data.get('photo', '').split('|'), profile)
     return profile
Beispiel #7
0
 def save(self, *args, **kwargs):
     org = super(FormOrganization, self).save(*args, **kwargs)
     UploadedFile.bind_files(
         self.cleaned_data.get('files', '').split('|'), org)
     return org
Beispiel #8
0
 def save(self, *a, **kw):
     proj = super(FormProject, self).save(*a, **kw)
     UploadedFile.bind_files(
         self.cleaned_data.get('partners_logo', '').split('|'), proj)
     return proj
Beispiel #9
0
 def save(self, *a, **kw):
     proj = super(FormProject, self).save(*a, **kw)
     UploadedFile.bind_files(
             self.cleaned_data.get('partners_logo', '').split('|'), proj)
     return proj
Beispiel #10
0
 def save(self, *args, **kwargs):
     comm = super(CommunityForm, self).save(*args, **kwargs)
     UploadedFile.bind_files(
         self.cleaned_data.get('files', '').split('|'), comm)
     return comm
Beispiel #11
0
 def save(self, *args, **kwargs):
     org = super(FormOrganization, self).save(*args, **kwargs)
     UploadedFile.bind_files(
         self.cleaned_data.get('files', '').split('|'), org)
     return org
Beispiel #12
0
 def save(self, *args, **kwargs):
     resource = super(FormResource, self).save(*args, **kwargs)
     UploadedFile.bind_files(
         self.cleaned_data.get('files', '').split('|'), resource)
     return resource
Beispiel #13
0
 def save(self, *args, **kwargs):
     need = super(NeedForm, self).save(*args, **kwargs)
     UploadedFile.bind_files(
         self.cleaned_data.get('files', '').split('|'), need)
     return need