display a field from last updated row

20 views
Skip to first unread message

sum abiut

unread,
Jun 15, 2017, 10:01:58 PM6/15/17
to django...@googlegroups.com


Hi,
i am having trouble trying to figure this out. I have a table something as below. i want to write an sqlalchemy that query the table and then display  the email address from the row that was last updated. Please point me to the right direction to help me accomplished that.





fname lname email phone
tom jon tj...@mail.com 555
James peter tj...@mail.com 555
john kas tj...@mail.com 555
tom jon tj...@mail.com 555




Mike Dewhirst

unread,
Jun 16, 2017, 12:47:58 AM6/16/17
to Django users
On 16/06/2017 12:01 PM, sum abiut wrote:
>
>
> Hi,
> i am having trouble trying to figure this out. I have a table
> something as below. i want to write an sqlalchemy that query the table
> and then display the email address from the row that was last
> updated. Please point me to the right direction to help me
> accomplished that.
>
>
>
>
>
> fname lname email phone
> tom jon tj...@mail.com <mailto:tj...@mail.com> 555
> James peter tj...@mail.com <mailto:tj...@mail.com> 555
> john kas tj...@mail.com <mailto:tj...@mail.com> 555
> tom jon tj...@mail.com <mailto:tj...@mail.com> 555
>
>

You will need an extra field of type models.DateTimeField(auto_now=True)
which gets automatically updated every time the record (model) is saved
if something has changed.




>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users...@googlegroups.com
> <mailto:django-users...@googlegroups.com>.
> To post to this group, send email to django...@googlegroups.com
> <mailto:django...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPCf-y7j%2BQ_06ZJC5EckAQJUuK70D00Mq0ivC0PxVMHYchfW1A%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAPCf-y7j%2BQ_06ZJC5EckAQJUuK70D00Mq0ivC0PxVMHYchfW1A%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages