Hello,

i've been away from django for quite a while. First of all, i'm really 
impressed about the current state of django.

After porting most of my code to the current stable, i'm now trying to 
understand how the save method of inlines can be overwritten. Here's a 
stripped down version of my code:

myproject.news.models:
======================
class Post(models.Model):
    date = models.DateTimeField(default=datetime.now())
    release = models.ForeignKey(Release, null=True, blank=True)

myproject.downloads.models:
===========================
class Release(models.Model):
    release_date = models.DateTimeField(default=datetime.now())

myproject.downloads.admin:
==========================
class PostInline(admin.StackedInline):
    model = Post
    max_num = 1
    exclude = ('date',)
    
class ReleaseAdmin(admin.ModelAdmin):
    inlines = [PostInline]

Now what i'm trying to achieve is to exclude Post.date from the inline form 
(works), but then again set it to value that has been entered for Release.date 
when the Release is saved. Can this be handled in PostInline? Is exclude 
suited for this case at all?

Best Regards,
Dirk Eschler

-- 
Dirk Eschler <dirk.esch...@gmx.net>
http://www.krusader.org




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to