Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
363 views
in Technique[技术] by (71.8m points)

django - How to return just the id number from queryset for a counter?

I'm really just a beginner in python and django... I'm looking for a way on how to get just the id of the last item in the queryset as a counter of posts for my project. I know about the ModelName.objects.last or .latest() however if I use last i still get the "Topic object (id)" I need just the id without the preceding text. Could anyone help me?

question from:https://stackoverflow.com/questions/65833240/how-to-return-just-the-id-number-from-queryset-for-a-counter

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...