omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    How to get Reminders of Specific Calendars

    Pythonista
    3
    5
    1912
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jmnickerson
      jmnickerson last edited by jmnickerson

      Howdy folks,

      I just started messing around with the reminders module, and I cannot figure out how to get all the reminders for a specific calendar or how to get the Calendar for specific reminders.

      I don't see any reference to how to do this in the documentation (http://omz-software.com/pythonista/docs/ios/reminders.html#reminders.Calendar), and inspecting Calendar and Reminder objects also seems fruitless.

      Relationships between the reminders/calendars is a pretty central concern so this seems like a huge omission.

      Does the reminders module truly omit this or am I missing something obvious?

      mikael 1 Reply Last reply Reply Quote 0
      • pulbrich
        pulbrich last edited by

        Did you try this?

        reminders.get_reminders(calendar=None, completed=None)
        

        Return all reminders in the given Calendar (or all calendars). Seems exactly what you are looking for.

        jmnickerson 1 Reply Last reply Reply Quote 1
        • mikael
          mikael @jmnickerson last edited by

          @jmnickerson, to find a specific calendar to use in the above, you need to do something like the following:

          	all_calendars = reminders.get_all_calendars()
          	for calendar in all_calendars:
          		if calendar.title == my_cal_name:
          			my_calendar = calendar
          			break
          
          jmnickerson 1 Reply Last reply Reply Quote 0
          • jmnickerson
            jmnickerson @pulbrich last edited by jmnickerson

            @pulbrich Oh ok. Party. That looks like just what I needed. Thanks 👌👍

            Something like this does the trick then.

            cals = {cal.title: reminders.get_reminders(calendar=cal,  completed=False) for cal in
            reminders.get_all_calendars()}
            
            1 Reply Last reply Reply Quote 0
            • jmnickerson
              jmnickerson @mikael last edited by

              @mikael

              Cool. Thanks for this 👍

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Powered by NodeBB Forums | Contributors