Changeset 13988 for trunk/sara_cmt/sara_cmt/django_cli.py
- Timestamp:
- 02/01/12 14:50:31 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sara_cmt/sara_cmt/django_cli.py
r12812 r13988 154 154 # Leave M2Ms for later, because they need an object's id 155 155 elif type(field) == ManyToManyField: 156 m2ms.append([field, arg_dict[arg]])156 m2ms.append([field, arg_dict[arg]]) 157 157 158 158 self._setattr(field=arg, value=arg_dict[arg]) … … 162 162 try: 163 163 self.save() 164 except :165 logger.warning(' Not enough data provided')164 except Exception as err: 165 logger.warning('%s: %s. Maybe not enough (unique) data provided?' % (type(err), err[-1] )) 166 166 167 167 for m2m in m2ms: … … 246 246 if isinstance(value, StringTypes): 247 247 value = [value] 248 logger.debug("Transformed value '%s' in list '%s'"%(value[0], value))248 logger.debug("Transformed value '%s' in list '%s'"%(value[0], value)) 249 249 250 250 # determine which fields should be searched for … … 278 278 if object_count is 0: 279 279 logger.warning('No matching object found; Change your query.') 280 pass281 280 elif object_count is 1: 282 281 _object = objects[0] … … 288 287 logger.warning('To many matching objects; Refine your query.') 289 288 # Try the match with the highest number of matches, ... 290 pass291 289 292 290 def _setm2m(self, field, values, subfields=None): … … 356 354 # like: for v in value: self.<append>(v) 357 355 logger.debug('Functionality to append values is still missing') 358 pass359 356 360 357
Note: See TracChangeset
for help on using the changeset viewer.