models.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:prestashop-sync 作者: dragoon 项目源码 文件源码
def do_default_site(self, using=DEFAULT_DB):
        """
        If no site was selected, selects the site used to create the article
        as the default site.

        Returns True if an additional save is required, False otherwise.
        """

        if not len(self.sites.all()):
            sites = Site.objects.all()
            if hasattr(sites, 'using'):
                sites = sites.using(using)
            self.sites.add(sites.get(pk=settings.SITE_ID))
            return True

        return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号