On Mon, Aug 12, 2013 at 9:46 AM, shiva krishna wrote:
> I have a model with two fields as below
>
> **models.py**
>
> class Publisher(models.Model):
> name = models.CharField(max_length=200)
> slug = models.SlugField(max_length=150, unique=True)
>
> def save(self, *args
I have a model with two fields as below
**models.py**
class Publisher(models.Model):
name = models.CharField(max_length=200)
slug = models.SlugField(max_length=150, unique=True)
def save(self, *args, **kwargs):
if not self.id and not self.slug:
2 matches
Mail list logo