daily pastebin goal
42%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. >>> from sentry.models import Event
  2. >>> from django.db.models import Q
  3. >>> events = Event.objects.all()
  4. >>> events = events.filter( Q(message__icontains="example") | Q(event_id__iexact="1") )
  5. >>> events.query.__str__()
  6. u'SELECT "sentry_message"."id", "sentry_message"."group_id", "sentry_message"."message_id", "sentry_message"."project_id", "sentry_message"."message", "sentry_message"."platform", "sentry_message"."datetime", "sentry_message"."time_spent", "sentry_message"."data" FROM "sentry_message" WHERE (UPPER("sentry_message"."message"::text) LIKE UPPER(%example%)  OR UPPER("sentry_message"."message_id"::text) = UPPER(1) )'
  7. >>> events = Event.objects.all()
  8. >>> events = events.filter( message__icontains="example") | events.filter(event_id__iexact="1" )
  9. >>> events.query.__str__()
  10. u'SELECT "sentry_message"."id", "sentry_message"."group_id", "sentry_message"."message_id", "sentry_message"."project_id", "sentry_message"."message", "sentry_message"."platform", "sentry_message"."datetime", "sentry_message"."time_spent", "sentry_message"."data" FROM "sentry_message" WHERE (UPPER("sentry_message"."message"::text) LIKE UPPER(%example%)  OR UPPER("sentry_message"."message_id"::text) = UPPER(1) )'
RAW Paste Data
Top