在Django / Python for Twilio中访问DateCreated和DateUpdated

时间:2022-06-10 11:43:12

Here's my first post! I'm working with a python web app that is recording phone calls. I am able to access client.recordings.uri, but I'm not able to access recordings.datecreated or dateupdated in my code.

这是我的第一篇文章!我正在使用一个正在录制电话的python网络应用程序。我能够访问client.recordings.uri,但我无法在我的代码中访问recordings.datecreated或dateupdated。

{% for recording in recordings %}
    <li><a href="{{ recording.uri }}.mp3">{{ recording.datecreated }} {{ recording.duration }} sec.</a></li>
    {% endfor %}

.uri and .duration are valid python attributes, does anyone know how to call the DateCreated attribute? Is it possible with the python module?

.uri和.duration是有效的python属性,有没有人知道如何调用DateCreated属性?是否可以使用python模块?

1 个解决方案

#1


1  

{% for recording in recordings %}
<li>
   <a href="{{ recording.uri }}.mp3">
    {{ recording.date_created }} {{ recording.duration }} sec.
  </a>
</li>
{% endfor %}

You'll need to add an underscore between datecreated. You can find a list of all attributes on the recording object here.

您需要在datecreated之间添加下划线。您可以在此处找到录制对象上所有属性的列表。

#1


1  

{% for recording in recordings %}
<li>
   <a href="{{ recording.uri }}.mp3">
    {{ recording.date_created }} {{ recording.duration }} sec.
  </a>
</li>
{% endfor %}

You'll need to add an underscore between datecreated. You can find a list of all attributes on the recording object here.

您需要在datecreated之间添加下划线。您可以在此处找到录制对象上所有属性的列表。