Hi Dave,
On Jan 11, 9:32 am, David Hall <
da...@etianen.com> wrote:
> The current way of detecting an object creation is to see if any version
> objects with an earlier datestamp exist for that model. The first Version
> object for a model is implicitly assumed to represent it's creation.
Here's what I came up with, where version is the current version
object I'm comparing against:
qs = Version.objects.filter(object_id=version.object_id,
content_type=version.content_type,
revision__date_created__lt=version.revision.date_created)
if qs.count() == 0:
created = True
Seems to work pretty good. Would you do this any differently?
Thanks!
-E