Exemplo n.º 1
0
 def import_boards(self):
     print "* Importing boards"
     rows = self._query("select * from smf_boards order by ID_PARENT")
     for row in rows:
         category = Category.objects.get(id=row['ID_CAT'])
         if row['ID_PARENT'] == 0:
             parent = None
         else:
             parent = Board.objects.get(id=row['ID_PARENT'])
         board = Board(
             id=row['ID_BOARD'],
             category=category,
             parent=parent,
             order=row['boardOrder'],
             name=row['name'],
             description=row['description'])
         disable_auto_now(board)
         board.save()