Hi,
I have implemented a custom save method for one of my models like this:
def save_model(self,request,obj,form,change):
if obj.slug == "" or obj.slug is None:
obj.slug = slugify(obj.title)
# I get database representation of the object to check if
# it was not published before and it is published now
# in order to set pub_date right
if change is True:
obj_db = Post.objects.get(pk=obj.id)
if obj_db.yayinlandi == False and obj.yayinlandi == True:
obj.pub_date = datetime.now()
obj.save()
And, I have a custom save method on my model like this:
def save(self,force_insert=False, force_update=False,using=None):
super(Post, self).save(force_insert, force_update,using=using)
if self.yayinlandi:
try:
ping_google('/sitemap.xml')
except:
pass
*
*
My problem is, I get a server error when trying to save, lets say, a varchar
value, which is bigger in length then specified by max_length argument. I
believe admin panel supposed to warn me when trying to save that value, and
I broke that behaviour by applying my custom save. Does anyone have an idea
what is going on an know how to fix this?
All of the project is in here: https://github.com/yasar11732/django-blog
--
http://yasar.serveblog.net/
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.