def import_tags(self): """imports OSQA tags to Askbot tags""" """ <object model="forum.tag" pk="2"> <field name="name" type="CharField"> pro </field> <field name="created_by" rel="ManyToOneRel" to="forum.user"> 1 </field> <field name="created_at" type="DateTimeField"> 2012-06-09 18:34:13 </field> <field name="used_count" type="PositiveIntegerField"> 259 </field> </object> """ for osqa_tag in self.get_objects_for_model('forum.tag'): tag = Tag() tag.name = osqa_tag.name tag.created_by = self.get_imported_object_by_old_id( User, osqa_tag.created_by) tag.used_count = osqa_tag.used_count tag.save()
def import_tags(self): """imports OSQA tags to Askbot tags""" """ <object model="forum.tag" pk="2"> <field name="name" type="CharField"> pro </field> <field name="created_by" rel="ManyToOneRel" to="forum.user"> 1 </field> <field name="created_at" type="DateTimeField"> 2012-06-09 18:34:13 </field> <field name="used_count" type="PositiveIntegerField"> 259 </field> </object> """ for osqa_tag in self.get_objects_for_model('forum.tag'): tag = Tag() tag.name = osqa_tag.name tag.created_by = self.get_imported_object_by_old_id(User, osqa_tag.created_by) tag.used_count = osqa_tag.used_count tag.save()