Changeset 1722 in main
- Timestamp:
- 11/07/12 15:14:39 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/openPLM/apps/document3D/models.py
r1665 r1722 234 234 if tempfile_size: 235 235 filename = new_STP_file.filename 236 path = docfs.get_available_name(filename )236 path = docfs.get_available_name(filename.encode("utf-8")) 237 237 shutil.copy(tempfile_size[0].name, docfs.path(path)) 238 238 new_doc = DocumentFile.objects.create(file=path, … … 307 307 else: 308 308 self._stps = DocumentFile.objects.none().values_list("id", flat=True) 309 q = Q(stp=doc_file) | Q(stp__in=self._stps) 309 q = Q(stp=doc_file) 310 stps = list(self._stps) 311 if stps: 312 q |= Q(stp__in=self._stps) 310 313 gfs = GeometryFile.objects.filter(q) 311 314 else: … … 670 673 old_product=Product_from_Arb(json.loads(old_arbre)) # doc_id and doc_path original 671 674 new_stp_file=DocumentFile() 672 name = new_stp_file.file.storage.get_available_name( product.name+".stp".encode("utf-8"))675 name = new_stp_file.file.storage.get_available_name((product.name+".stp").encode("utf-8")) 673 676 new_stp_path = os.path.join(new_stp_file.file.storage.location, name) 674 677 f = File(open(new_stp_path, 'w'))
Note: See TracChangeset
for help on using the changeset viewer.