0004-formdata-ease-iteration-of-evolutions-parts-33186.patch
wcs/formdata.py | ||
---|---|---|
1042 | 1042 |
field.feed_session(self.data.get(field.id), |
1043 | 1043 |
self.data.get('%s_display' % field.id)) |
1044 | 1044 | |
1045 |
def iter_evolution_parts(self, klass=None): |
|
1046 |
for evo in self.evolution or []: |
|
1047 |
for part in evo.parts or []: |
|
1048 |
if klass is None or isinstance(part, klass): |
|
1049 |
yield part |
|
1050 | ||
1045 | 1051 |
def __getattr__(self, attr): |
1046 | 1052 |
try: |
1047 | 1053 |
return self.__dict__[attr] |
wcs/workflows.py | ||
---|---|---|
127 | 127 | |
128 | 128 |
def get_attachments(self): |
129 | 129 |
attachments = [] |
130 |
for evo in self.formdata.evolution or []: |
|
131 |
for part in evo.parts or []: |
|
132 |
if not isinstance(part, AttachmentEvolutionPart): |
|
133 |
continue |
|
130 |
for part in self.formdata.iter_evolution_parts(AttachmentEvolutionPart): |
|
134 | 131 |
if part.varname != self.varname: |
135 | 132 |
continue |
136 | 133 |
attachments.append(part) |
... | ... | |
2812 | 2809 |
import wf.profile |
2813 | 2810 |
import wf.backoffice_fields |
2814 | 2811 |
import wf.redirect_to_url |
2812 |
import wf.formdata |
|
2815 | 2813 | |
2816 | 2814 |
from wf.export_to_model import ExportToModel |
2817 |
- |