I´m having 2 models, where one is edited inline.
Now, I have to make some customization to the admins add- and change-
form (view and template).

Question is: Should I go for formsets.py in the newadmin-branch or is
there another (maybe easier) possibility?
If I should use formsets.py, does anyone have an example on how to use
it?

Below are the models (don´t know if that information is necessary
though).

Thanks,
Patrick

class CinemaProgram(models.Model):
    """
    Kinoprogramm - Verknüpfung von Kino, Film und evt.
Spezialprogramm.
    """
    from www.festivals.models import SpecialScreening

    cinema = models.ForeignKey(Cinema, verbose_name="Kino")
    movie = models.ForeignKey(Movie, raw_id_admin=True,
verbose_name="Film")
    specialscreening = models.ForeignKey(SpecialScreening,
raw_id_admin=True, blank=True, null=True,
related_name="rel_specialscreening", verbose_name="Spezialprogramm")
    # Additionals
    add_info = models.CharField('Zusatzinfo', maxlength=100,
blank=True, null=True)
    # Manager
    objects = DateManager()

    class Meta:
        verbose_name = "Kinoprogramm"
        verbose_name_plural = "Kinoprogramme"
        ordering = ['cinema', 'movie']

    class Admin:
        list_display = ('id', 'cinema', 'movie', 'specialscreening',)
        list_display_links = ('cinema',)
        list_filter = ('cinema',)

    def __unicode__(self):
        return u"%s" % (self.movie.title)


class CinemaProgramDate(models.Model):
    """
    Kinoprogramm - Beginnzeiten und Saalinformation.
    """

    cinemaprogram = models.ForeignKey(CinemaProgram,
edit_inline=models.TABULAR, num_in_admin=20, max_num_in_admin=200,
num_extra_on_change=20)
    # Date/Time
    screening_date = models.DateField('Datum', core=True)
    screening_time = models.TimeField('Beginnzeit', core=True)
    # Additionals
    add_screen = models.CharField('Saal', maxlength=50)
    add_info = models.CharField('Zusatzinfo', maxlength=100,
blank=True, null=True)
    add_version = models.ForeignKey(Version, blank=True, null=True,
verbose_name="Version")

    class Meta:
        verbose_name = "Kinoprogramm (Zeiten)"
        verbose_name_plural = "Kinoprogramme (Zeiten)"
        ordering = ['add_screen', 'screening_date', 'screening_time']

    class Admin:
        list_display = ('cinemaprogram', 'screening_date',
'screening_time', 'add_version',)

    def __unicode__(self):
        return u"%s %s" % (self.screening_date, self.screening_time)


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to