Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 2 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
View
4 geocamTalk/fixtures/demoTalkMessages.json
@@ -1,8 +1,8 @@
[{"pk": 1, "model": "geocamTalk.talkmessage", "fields": {"recipients": [0], "author": 1, "altitude": null, "longitude": -122.11103110000001, "heading": null, "content": "hello", "content_timestamp": "2011-03-16 21:55:07", "position_timestamp": null, "latitude": 37.401637700000002, "speed": null, "cid": "49689939c6734fc59120ecf9fce5580d", "accuracy": 138.0}},
{"pk": 2, "model": "geocamTalk.talkmessage", "fields": {"recipients": [0], "author": 1, "altitude": 0.0, "longitude": -122.1111588, "heading": null, "content": "bogus", "content_timestamp": "2011-03-16 21:58:38", "position_timestamp": null, "latitude": 37.401529199999999, "speed": null, "cid": "8fe5fc3123c64a87a08708f3d0a84c3d", "accuracy": 35.0}},
-{"pk": 3, "model": "geocamTalk.talkmessage", "fields": {"recipients": [0, 2, 3, 4], "author": 1, "altitude": null, "longitude": -122.11103110000001, "heading": null, "content": "Holy crap, did you feel that earthquake?", "content_timestamp": "2011-03-16 22:37:34", "position_timestamp": null, "latitude": 37.401637700000002, "speed": null, "cid": "fa131ec140f84a9f8af7421a6d2a6f25", "accuracy": 138.0,"audio_file": "car-honk-2.mp3"}},
+{"pk": 3, "model": "geocamTalk.talkmessage", "fields": {"recipients": [0, 2, 3, 4], "author": 1, "altitude": null, "longitude": -122.11103110000001, "heading": null, "content": "Holy crap, did you feel that earthquake?", "content_timestamp": "2011-03-16 22:37:34", "position_timestamp": null, "latitude": 37.401637700000002, "speed": null, "cid": "fa131ec140f84a9f8af7421a6d2a6f25", "accuracy": 138.0,"audio_file": "car-honk-2.mp4"}},
{"pk": 4, "model": "geocamTalk.talkmessage", "fields": {"recipients": [0, 4, 5], "author": 1, "altitude": null, "longitude": -122.11103110000001, "heading": null, "content": "Dude, I think I just got some radiation poisoning from that reactor.", "content_timestamp": "2011-03-16 22:38:04", "position_timestamp": null, "latitude": 37.401637700000002, "speed": null, "cid": "cefad07b5eb1439287dcc88877809049", "accuracy": 138.0}},
{"pk": 5, "model": "geocamTalk.talkmessage", "fields": {"recipients": [0, 2, 3, 4], "author": 1, "altitude": null, "longitude": -122.11103110000001, "heading": null, "content": "A dingo stole my baby.", "content_timestamp": "2011-03-16 22:38:38", "position_timestamp": null, "latitude": 37.401637700000002, "speed": null, "cid": "5d878e265bcb4b768c5fb1cf41183e44", "accuracy": 138.0}},
{"pk": 6, "model": "geocamTalk.talkmessage", "fields": {"recipients": [],"author": 3, "altitude": null, "longitude": -122.4048743, "content": "Some crazy stuff is happening in this neighborhood.", "content_timestamp": "2011-02-19 21:34:46", "position_timestamp": "2011-02-19 15:37:53", "latitude": 37.746198499999998, "speed": null, "heading": null, "accuracy": 190.0,"cid": "5f01f5679c5a4606929e70cb4b903224"}},
{"pk": 7, "model": "geocamTalk.talkmessage", "fields": {"recipients": [],"author": 3, "altitude": null, "longitude": -122.4048743, "content": "Casualties are littering the streets!", "content_timestamp": "2011-02-19 21:35:29", "position_timestamp": "2011-02-19 15:37:53", "latitude": 37.746198499999998, "speed": null, "heading": null, "accuracy": 190.0,"cid": "5f01f5679c5a4606929e70cb4b903125"}},
-{"pk": 8, "model": "geocamTalk.talkmessage", "fields": {"recipients": [],"author": 3, "altitude": null, "longitude": -122.4048743, "content": "The hospital is full, no more beds...", "content_timestamp": "2011-02-19 21:35:52", "position_timestamp": "2011-02-19 15:37:53", "latitude": 37.746198499999998, "speed": null, "heading": null, "accuracy": 190.0,"cid": "5f01f5679c5a4606929e70114b903b65","audio_file": "car-honk-2.mp3"}}]
+{"pk": 8, "model": "geocamTalk.talkmessage", "fields": {"recipients": [],"author": 3, "altitude": null, "longitude": -122.4048743, "content": "The hospital is full, no more beds...", "content_timestamp": "2011-02-19 21:35:52", "position_timestamp": "2011-02-19 15:37:53", "latitude": 37.746198499999998, "speed": null, "heading": null, "accuracy": 190.0,"cid": "5f01f5679c5a4606929e70114b903b65","audio_file": "car-honk-2.mp4"}}]
View
2  geocamTalk/models.py
@@ -37,7 +37,7 @@ class TalkMessage(GeocamMessage):
"""
#TODO - add time to filename location
- audio_file = models.FileField(null=True, blank=True, upload_to='geocamTalk/audio') #"%s-audio" % (GeocamMessage.author))
+ audio_file = models.FileField(null=True, blank=True, upload_to='geocamTalk/audio/%Y/%m/%d') #"%s-audio" % (GeocamMessage.author))
def __unicode__(self):
try:
View
4 geocamTalk/templates/geocamTalk/message_list.html
@@ -44,7 +44,9 @@
said
{% if m.has_geolocation %}<img src="/resources/map.png" />{%endif%}
{% if m.has_audio %}
- I HAVE AUDIO
+ <audio controls="controls">
+ <source src={{ m.audio_file.filename }} >
+ </audio>
{%endif%}
</dt>
<dd id="message_{{m.pk}}_content">
View
2  geocamTalk/views.py
@@ -117,7 +117,7 @@ def create_message_json(request):
message = TalkMessage.fromJson(messageDict)
if "audio" in request.FILES:
- filename = request.FILES['audio'].name
+ filename = "%s%s.mp4" % (message.author, message.content_timestamp.strftime("%H%M%S"))
file_content = ContentFile(request.FILES['audio'].read())
file_format = os.path.splitext( request.FILES['audio'].name)[-1]
message.audio_file.save(filename, file_content)

No commit comments for this range

Something went wrong with that request. Please try again.