Esempio n. 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
Esempio n. 2
0
    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
Esempio n. 3
0
    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
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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