title: Django: Check if a object exists but isn't current instance of object
body: <p>I've put together a basic CMS system for a project and I'm adding an order system so that you can order the created pages in the nav bar. Unfortunately the custom validator I've written is a little to aggressive and raises and error when you edit a page because, correctly, the order already exists in the database.</p>
  
  <p>Model the form is based on:</p>
  
  <pre><code>class Page(models.Model):
  page_name = models.CharField(max_length=100)
  page_content = models.CharField(max_length=16777000)
  link = models.URLField(blank=True)
  order = models.IntegerField()
  </code></pre>
  
  <p>Custom Validator:</p>
  
  <pre><code>def clean_order(self):
      data = self.cleaned_data['order']
      pg = Page.objects.filter(order=data)
      if pg.count() &gt; 0:
          raise forms.ValidationError("This order number already exists. Use another.")
      return data
  </code></pre>
  
  <p>Is there any way for me to, upon performing the update, have the custom validator only raise an error if the new order already exists BUT where it is not current Page object. Something like:</p>
  
  <pre><code>pg = Page.objects.filter(order=data).filter(pk!=editpagepk)
  </code></pre>
  
  <p>Thanks!</p>