Skip to content
Snippets Groups Projects
  • Jared Hancock's avatar
    b2e7da58
    orm: Implement annotation support · b2e7da58
    Jared Hancock authored
    This allows for things like related COUNTs and such:
    
    ```php
    ThreadEntry::objects()->annotate(
        'attachment_count'=>Aggregate::COUNT('attachments')
        )
        ->filter(array('attachments__type__contains'=>'image/'))
        ->filter(array('attachment_count__gt'=>0));
    ```
    This would find all thread entries with at least one image attached.
    b2e7da58
    History
    orm: Implement annotation support
    Jared Hancock authored
    This allows for things like related COUNTs and such:
    
    ```php
    ThreadEntry::objects()->annotate(
        'attachment_count'=>Aggregate::COUNT('attachments')
        )
        ->filter(array('attachments__type__contains'=>'image/'))
        ->filter(array('attachment_count__gt'=>0));
    ```
    This would find all thread entries with at least one image attached.