<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -139,7 +139,10 @@ class PositionField(models.IntegerField):
         # instantiated keeps this method from doing the right thing.
         # Fortunately it works on newforms-admin, so it will be moot soon.
 
-        has_pk = bool(getattr(instance, instance._meta.pk.attname))
+        try:
+            has_pk = bool(getattr(instance, instance._meta.pk.attname))
+        except AttributeError:
+            has_pk = False
 
         # default to None for existing instances; -1 for new instances
         updated = None if has_pk else -1</diff>
      <filename>positions/fields.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c44877c9f26b4b285021ed29ef594fcdcf372cad</id>
    </parent>
  </parents>
  <author>
    <name>Joel Watts</name>
    <email>joel@joelwatts.com</email>
  </author>
  <url>http://github.com/jpwatts/django-positions/commit/1dcacc3cf86bffd48165852c301adba1206ee34e</url>
  <id>1dcacc3cf86bffd48165852c301adba1206ee34e</id>
  <committed-date>2009-08-13T11:12:41-07:00</committed-date>
  <authored-date>2009-08-13T11:12:41-07:00</authored-date>
  <message>Don't fail when there isn't a primary key.

This addresses an incompatibility with South migrations as reported by mb0:

http://github.com/jpwatts/django-positions/issues#issue/1</message>
  <tree>1ebaeb5d83957c3323e18469af903ce6b25de092</tree>
  <committer>
    <name>Joel Watts</name>
    <email>joel@joelwatts.com</email>
  </committer>
</commit>
