Join Query Scopes
As you said, your issue is a circular import. That's not really an issue peewee is designed to solve. In OO terms you probably need to add a third class that can read both modules and then route your access through that. @coleifer Thanks for taking a look at this!

Are you familiar with active record? What I'm talking about is pretty common and is called an association scope.

Examples: 
```
belongs_to :firm, -> { where(id: 2) }
belongs_to :user, -> { joins(:friends) }
belongs_to :level, ->(level) { where("game_level > ?", level.current) }
```

http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#label-Customizing+the+query

The way peewee seems to be designed makes it impossible to put an association scope in the class, but I'm really hoping that I am wrong here. 

Does what I'm shooting for make more sense now? 
Hi!

I'm trying to put a where statement in a model class and use that in a relation as a scope. 

```
class Pizza(Model):
    brand = ... blah blah
    
    @classmethod
    def where_cheddar(cls):
         return cls.toppings.where(Topping.type == "CHEDDAR") #HERE IS AN ERROR / CIRCULAR IMPORT

class Topping(Model):
    pizza = ForeignKeyField(Pizza, related_name="toppings")
    type = Text.... 

    def where_cheddar(self):
        return self.where(Topping.type = "CHEDDAR")

```

There are two ways I'd like to be able to do this: The first is less DRY but is the circular import above. 

If I skip the circular import and write this using the instance method for topping: 

```
pizza = Pizza.select().first()
pizza.toppings.where_cheddar()
```

I get a 'SelectQuery' object has no attribute where_cheddar error because the foreign key field relation returns a select query and where_cheddar operates on the Topping class. 

I'm sure there is a way to do this, but I must be missing something. 

Any help would be appreciated. Thanks! 

**EDIT:**

I found model_class on SelectQuery, but this feels dirty. 

I would have to do:

```
 return cls.toppings.where( cls.toppings.model_class.type == "CHEDDAR") 

```

It violates the encapsulation of the Topping class.