コード例 #1
0
def _update_part_info(user, asset, part_info_data):
    if not asset.part_info:
        part_info = PartInfo()
    else:
        part_info = asset.part_info
    part_info.device = part_info_data.get('device')
    part_info.source_device = part_info_data.get('source_device')
    part_info.barcode_salvaged = part_info_data.get('barcode_salvaged')
    part_info.save(user=user)
    asset.part_info = part_info
    asset.part_info.save(user=user)
    return asset
コード例 #2
0
ファイル: views.py プロジェクト: deejay1/ralph_assets
def _update_part_info(user, asset, part_info_data):
    if not asset.part_info:
        part_info = PartInfo()
    else:
        part_info = asset.part_info
    part_info.device = part_info_data.get('device')
    part_info.source_device = part_info_data.get('source_device')
    part_info.barcode_salvaged = part_info_data.get('barcode_salvaged')
    part_info.save(user=user)
    asset.part_info = part_info
    asset.part_info.save(user=user)
    return asset
コード例 #3
0
 def create_part_info(self):
     part_info = PartInfo()
     part_info.source_device = self.asset
     part_info.device = self.asset
     part_info.save(user=self.request.user)
     return part_info
コード例 #4
0
ファイル: device.py プロジェクト: xliiv/ralph_assets
 def create_part_info(self):
     part_info = PartInfo()
     part_info.source_device = self.asset
     part_info.device = self.asset
     part_info.save(user=self.request.user)
     return part_info