def get_queryset(self): """ Returns a QuerySet which access remote SF objects. """ if router.is_sf_database(self.db): q = models_sql_query.SalesforceQuery(self.model, where=compiler.SalesforceWhereNode) return query.SalesforceQuerySet(self.model, query=q, using=self.db) return super(SalesforceManager, self).get_queryset()
def get_queryset(self, _alias=None): """ Returns a QuerySet which access remote SF objects. """ alias_is_sf = _alias and router.is_sf_database(_alias) extended_model = getattr(self.model, '_salesforce_object', '') == 'extended' if router.is_sf_database(self.db) or alias_is_sf or extended_model: q = models_sql_query.SalesforceQuery(self.model, where=compiler.SalesforceWhereNode) return query.SalesforceQuerySet(self.model, query=q, using=self.db) return super(SalesforceManager, self).get_queryset()
def get_queryset(self): """ Returns a QuerySet which access remote SF objects. """ if not router.is_sf_database(self.db): return super(SalesforceManager, self).get_queryset() else: from salesforce.backend import query, compiler q = query.SalesforceQuery(self.model, where=compiler.SalesforceWhereNode) return query.SalesforceQuerySet(self.model, query=q, using=self.db)
def get_queryset(self, _alias: Optional[str] = None) -> 'QuerySet[_T]': """ Returns a QuerySet which access remote SF objects. """ alias_is_sf = _alias and router.is_sf_database(_alias) is_extended_model = getattr(self.model, '_salesforce_object', '') == 'extended' assert self.model is not None if router.is_sf_database(self.db) or alias_is_sf or is_extended_model: return query.SalesforceQuerySet(self.model, using=self.db) return super(SalesforceManager, self).get_queryset()