addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1linklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

Helpful examples of Django QuerySet & Django, Postgres, Timezones, and You

NOTE: We've changed the location of this meetup to be back in San Francisco so that hopefully more people will be able to attend!

In this month's talk we have two, 30 min talks from engineers at Counsyl. 

Talk #1 Counsyl.objects.filter(django_queryset_type=EXAMPLES, helpful=True)

(Helpful examples of Django QuerySet use at Counsyl)

This talk is about advanced use of Django's QuerySet API based on lessons learned at Counsyl. You'll learn how to debug, optimize and use the QuerySet API efficiently. The main examples focus on demystifying how QuerySet maps to SQL and how seemingly simple Python code, presumably fast O(1) queries, can result in unacceptably long runtime and often O(N) or worse queries. Solutions are provided for keeping your Python code simple and RDMS use performant.

Speaker Bio:

Jayson Falker is a software developer for Counsyl. He has an EEN/CS degree and a PhD in Bioinformatics. He is a long-time open-source Linux/Java/Web developer, book author, and presenter. He has focused on proteomics and genomics research since the mid-2000's, including working for a few years at startups and for Dow AgroSciences. Jayson is quick to get his geek on and also loves to build ridiculous side-projects, including a 6' tall Jenga set that weighs 300lbs and mobile apps that give you awesome virtual mustaches.

Talk #2 Django, Postgres, Timezones, and You

Dealing with multiple time zones can be tricky and it is easy to run into problems if you are not careful. This talk explores some of the potiential pitfalls when working with timestamps in Django and Postgres and how to deal with them.

Consider the following code:

   dt =

   myobj = MyDjangoModel.objects.create(timestamp=dt)

   myobj = MyDjangoModel.objects.get(

Would you expect that 'myobj.timestamp == dt'? With the default Django settings that is not guaranteed to be the case; come to this talk and find out why.

Speaker Bio: 

Dave Peticolas is a software engineer at Counsyl. Prior to that he was a software engineer at Lucasfilm for ten years. He has contributed to numerous open source projects including GnuCash and Twisted, and is the author of a popular introduction to Twisted and asynchronous programming at


5:30pm - Check in and socialize. There will be some pizza and drinks provided by Hearsay Social!

6:15pm - Lightning talks if we have any

6:30pm - Jayson's talk

7:00pm - Dave's talk

8:00pm - Time to head home

Notes from Hearsay Social:

• Doors will open at 5:30pm to allow enough time for the check-in process.

• Please update the name on your account to reflect your FIRST NAME and LAST NAME. Hearsay Social Security will be checking IDs at the door. *Please note: You WILL ONLY be allowed into the event if we have your first and last name (that matches the name on your ID) prior to the event.

• Hearsay Social is generously providing us with their venue space. Let's make sure we treat it with respect and clean up after ourselves.


Counsyl is a medical genomics startup in South San Francisco, California. Our goal is to make the human genome practically useful for life- altering decisions.

We invented the Counsyl Test, a breakthrough diagnostic intended for parents planning to start a family. It was featured in the New York Times, named one of Scientific American’s Top 10 World Changing Ideas, and won the Wall Street Journal Innovation Award for Medicine. Our test is now being used for 12% of all carrier screens in the United States.

The cost of sequencing human genomes is plunging - over 5x faster than the cost of computing; the potential impact on preventive healthcare and the medical landscape is boundless. The science is there but the scale isn't. That's where Counsyl comes in. We are building the technology platform to make genomics useful and accessible to everyone.

The vast majority of our operations are powered by our own custom-built infrastructure on a Python/Django/Postgres stack, from ordering to lab processing to billing. We’re building new tools, new workflows, and new infrastructure to solve the challenging problems of a technology startup involved with not just bits, but also interconnected physical components like lab robotics and patient samples.

Join or login to comment.

  • Justine L.

    Dave Peticolas wrote up a blog post on his talk:

    Jayson's talk will be posted in a week or so. Thanks to those of you that could make it out last night and thanks to Rudy for organizing and Hearsay Social for the space, drinks and snacks!

    1 · October 10, 2013

  • John K.


    Did you know that Dave Peticolas, one of our speaker last night, also wrote a totural( on Twisted? I just stumbled upon it. So, I haven't read it. After skimming it, it looks quite good. -jk

    October 10, 2013

  • John K.

    For ease of reference and those who couldn't attend, here is a pointer to the code and writeup for Jayson Falkner's presentation

    October 10, 2013

  • Stefan M.

    Jason's talk on optimizing Django QuerySets gave some great tips: especially for using the .annotate and .values_list methods. I downloaded his github project, but in demo/counsyl/db/, I could only find pg_bulk_update, and not the other methods he mentioned such as pg_multi_column_index or pg_bulk_create.

    Dave's talk on Postgres, Timezones and You, proved once again, that a well thought out testing matrix is paramount. In particular, test case 7 was very instructive, which showed that the storage and retrieval errors could appear to cancel themselves out, EXCEPT when the date was chosen to be the day before daylight savings time. You know something must have gone wrong when the queryset returned a date in the future!

    October 9, 2013

    • Kevin H.

      I think the other methods are in demo-optimized/counsyl/d­b/

      October 9, 2013

    • Stefan M.

      Thanks - I didn't expect it to be there.

      October 9, 2013

  • Rudy M.

    For anyone coming to the meetup, head all the way down to the last lobby (#5) and take the elevator up to the 3rd floor.

    October 9, 2013

  • coban T.

    It's a bit early for me to to get to SOMa from Sunnyvale.

    October 9, 2013

  • Dennis C.

    Too early for me, looking forward to the next one!

    October 9, 2013

  • Lee R.

    Can't make it Wednesdays

    October 4, 2013

  • Josh B.

    FWIW, it wasn't the location -- I can't come due to a schedule conflict. Otherwise, I'd be there for certain.

    1 · October 4, 2013

Our Sponsors

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy