Instead of fetching `all()` and doing the filtering with an `if` you can let the database do the work for you.
`for u in orm['users.externalaccount'].objects.filter(type=ExternalAccount.TYPE_TWITTER)`