It will be different depending on the database (assuming you are asking about the query only). You will need to do an order by on either your auto incremented field or dat field plus something like a limit 2 (Postgres and I believe MySQL) or top 2 for something like SQL Server.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/017701cf8aee%24d51d7200%247f585600%24%40JetBrains.com.
Erik is certainly right on this. All queries are point in time and in databases with large numbers of inserts per second, getting the true last two inserts will be relative to when the query starts.
--
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.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/A9576EA4-D3D5-4E5E-836E-0B5CE450FBE2%40cederstrand.dk.