File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -451,8 +451,9 @@ class Room(models.Model):
451
451
# end floorplan-related stuff
452
452
453
453
def __str__ (self ):
454
- return u"%s size: %s" % (self .name , self .capacity )
455
-
454
+ if len (self .functional_name ) > 0 and self .functional_name != self .name :
455
+ return f"{ self .name } [{ self .functional_name } ] (size: { self .capacity } )"
456
+ return f"{ self .name } (size: { self .capacity } )"
456
457
457
458
def dom_id (self ):
458
459
return "room%u" % (self .pk )
Original file line number Diff line number Diff line change @@ -140,13 +140,13 @@ def test_location_options(self):
140
140
rendered = str (TimeSlotEditForm (instance = ts )['location' ])
141
141
# noinspection PyTypeChecker
142
142
self .assertInHTML (
143
- f'<option value="{ ts .location .pk } " selected>{ ts .location . name } size: None </option>' ,
143
+ f'<option value="{ ts .location .pk } " selected>{ ts .location } </option>' ,
144
144
rendered ,
145
145
)
146
146
for room in rooms :
147
147
# noinspection PyTypeChecker
148
148
self .assertInHTML (
149
- f'<option value="{ room .pk } ">{ room . name } size: { room . capacity } </option>' ,
149
+ f'<option value="{ room .pk } ">{ room } </option>' ,
150
150
rendered ,
151
151
)
152
152
Original file line number Diff line number Diff line change 121
121
< tr >
122
122
< th scope ="row ">
123
123
< span class ="room-heading "> {{ room.name }}
124
+ {% if room.functional_name and room.name != room.functional_name %} - {{ room.functional_name }}{% endif %}
124
125
{% if room.capacity %}< span class ="capacity "> ({{ room.capacity }})</ span > {% endif %}
125
126
</ span >
126
127
</ th >
You can’t perform that action at this time.
0 commit comments