diff options
author | Leif Johansson <leifj@sunet.se> | 2013-03-04 08:08:42 +0100 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2013-03-04 08:08:42 +0100 |
commit | 2752cb0857dc3c7e5e9a06a7e713b0fdb71f6aba (patch) | |
tree | 149460fc3d672480e968ab71cef01b6c0ee9b04d | |
parent | d9e0c635493f04d7764044e6098de9e458810a10 (diff) |
prefetch tags
-rw-r--r-- | meetingtools/apps/room/models.py | 2 | ||||
-rw-r--r-- | meetingtools/apps/room/views.py | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/meetingtools/apps/room/models.py b/meetingtools/apps/room/models.py index 86acbc4..12f4b1d 100644 --- a/meetingtools/apps/room/models.py +++ b/meetingtools/apps/room/models.py @@ -35,12 +35,14 @@ class FileLock(object): def __delete__(self): raise AttributeError + class RoomLockedException(Exception): def __init__(self, value): self.value = value def __str__(self): return repr(self.value) + class Room(models.Model): creator = ForeignKey(User,editable=False) name = CharField(max_length=128) diff --git a/meetingtools/apps/room/views.py b/meetingtools/apps/room/views.py index dd7e2b1..ffd222d 100644 --- a/meetingtools/apps/room/views.py +++ b/meetingtools/apps/room/views.py @@ -92,6 +92,7 @@ def view(request,id): 'active': True, }) + def _init_update_form(request,form,acc,folder_sco): if form.fields.has_key('urlpath'): url = base_url(request) @@ -99,6 +100,7 @@ def _init_update_form(request,form,acc,folder_sco): if form.fields.has_key('source_sco'): form.fields['source_sco'].widget.choices = [('','-- select template --')]+[r for r in _user_templates(request,acc,folder_sco)] + def _update_room(request, room, data=dict(), acc=None): params = {'type':'meeting'} @@ -321,7 +323,7 @@ def list_rooms(request,username=None): rooms = [] if user: - rooms = Room.objects.filter(creator=user).order_by('name').all().prefetch_related("creator","sco","folder_sco","source_sco","deleted_sco") + rooms = Room.objects.filter(creator=user).order_by('name').all().prefetch_related("creator","sco","folder_sco","source_sco","deleted_sco","tags") return respond_to(request, {'text/html':'apps/room/list.html'}, |