1.1 --- a/imiptools/stores/common.py Sat Oct 07 22:08:13 2017 +0200
1.2 +++ b/imiptools/stores/common.py Thu Oct 12 23:14:06 2017 +0200
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 General support for calendar data storage.
1.6
1.7 -Copyright (C) 2014, 2015, 2016 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2014, 2015, 2016, 2017 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -484,6 +484,15 @@
1.13
1.14 pass
1.15
1.16 + def get_counter_recurrences(self, user, uid):
1.17 +
1.18 + """
1.19 + For the given 'user', return a list of recurrence identifiers describing
1.20 + counter-proposals for the parent event with the given 'uid'.
1.21 + """
1.22 +
1.23 + pass
1.24 +
1.25 def get_counter(self, user, other, uid, recurrenceid=None):
1.26
1.27 """
2.1 --- a/imiptools/stores/database/common.py Sat Oct 07 22:08:13 2017 +0200
2.2 +++ b/imiptools/stores/database/common.py Thu Oct 12 23:14:06 2017 +0200
2.3 @@ -662,6 +662,27 @@
2.4 self.cursor.execute(query, values)
2.5 return self.get_single_values()
2.6
2.7 + def get_counter_recurrences(self, user, uid):
2.8 +
2.9 + """
2.10 + For the given 'user', return a list of recurrence identifiers describing
2.11 + counter-proposals for the parent event with the given 'uid'.
2.12 + """
2.13 +
2.14 + table = self.get_recurrence_table("counters")
2.15 +
2.16 + columns = ["store_user", "object_uid"]
2.17 + values = [user, uid]
2.18 +
2.19 + query, values = self.get_query(
2.20 + "select object_recurrenceid from %(table)s :condition" % {
2.21 + "table" : table
2.22 + },
2.23 + columns, values)
2.24 +
2.25 + self.cursor.execute(query, values)
2.26 + return self.get_single_values()
2.27 +
2.28 def get_counter(self, user, other, uid, recurrenceid=None):
2.29
2.30 """
3.1 --- a/imiptools/stores/file.py Sat Oct 07 22:08:13 2017 +0200
3.2 +++ b/imiptools/stores/file.py Thu Oct 12 23:14:06 2017 +0200
3.3 @@ -568,6 +568,19 @@
3.4
3.5 return [name for name in listdir(filename) if isfile(join(filename, name))]
3.6
3.7 + def get_counter_recurrences(self, user, uid):
3.8 +
3.9 + """
3.10 + For the given 'user', return a list of recurrence identifiers describing
3.11 + counter-proposals for the parent event with the given 'uid'.
3.12 + """
3.13 +
3.14 + filename = self.get_object_in_store(user, "counters", "recurrences", uid)
3.15 + if not filename or not isdir(filename):
3.16 + return []
3.17 +
3.18 + return listdir(filename)
3.19 +
3.20 def get_counter(self, user, other, uid, recurrenceid=None):
3.21
3.22 """