class VkUserGroup(BaseModel):
vk_user = ForeignKeyField(VkUser)
vk_group = ForeignKeyField(VkGroup)
class Meta:
db_table = 'vk_users_groups'
primary_key = CompositeKey('vk_user', 'vk_group')
query = VkUserGroup.select().limit(10)
for vk in query.execute():
print(vk)