(self, new_urls)
Adds missing URLS from new_urls

        The order of existing URLs is not changed
Adds missing URLS from new_urls
Adds missing URLS from new_urls
def add_missing_urls(self, new_urls):
        """Adds missing URLS from new_urls

        The order of existing URLs is not changed"""
        existing_urls = self.urls.all()
        next_order = max([-1] + [u.order for u in existing_urls]) + 1
        existing_urls = [u.url for u in existing_urls]

        for url in new_urls:
            if url in existing_urls:
                continue

            try:
                URL.objects.create(
                    url=url, order=next_order, scope=self.scope, content_object=self
                )
                next_order += 1
            except (IntegrityError, DataError) as ie:
                err = str(ie)
                logger.warning(u"Could not add URL: {0}".format(err))
                continue
def add_missing_urls ( self , new_urls ) : existing_urls = self . urls . all ( ) next_order = max ( [ - 1 ] + [ u . order for u in existing_urls ] ) + 1 existing_urls = [ u . url for u in existing_urls ] for url in new_urls : if url in existing_urls : continue try : URL . objects . create ( url = url , order = next_order , scope = self . scope , content_object = self ) next_order += 1 except ( IntegrityError , DataError ) as ie : err = str ( ie ) logger . warning ( u"Could not add URL: {0}" . format ( err ) ) continue