What I want to do is have a form with one field that allows you to
select a profile. Once this profile is selected there will be two
windows below that show available tests and selected tests. The Django
admin interface for the user permissions uses this format. Not sure
what it is called in Django.

My current models are listed below. I have a joining table called
Testsuite that joins tests to profiles. It works now, but the admin is
not very easy to add or remove tests to a testsuite since you have to
add one at a time. If someone can point me in the right direction I
would appreciate it.


Anyway I have the following models:
---------------------------------------------------
Models
--------------------------------------------------

class Profile(models.Model):
    profile_id = models.AutoField(primary_key=True)
    profile_name = models.CharField(max_length=75)
    description = models.CharField(max_length=1500, blank=True)
    def __unicode__(self):
                        return self.profile_name
    class Meta:
        db_table = u'profile'

class Testcase(models.Model):
    test_id = models.AutoField(primary_key=True)
    test_name = models.CharField(max_length=300)
    src = models.ForeignKey(Source, null=True, blank=True)
    bitrate = models.IntegerField(null=True, blank=True)
    test_type = models.CharField(max_length=300)
    output_resolution = models.CharField(max_length=15, blank=True)
    description = models.CharField(max_length=3000, blank=True)
    ref_file = models.CharField(max_length=765, blank=True)
    ref_encode_filesize = models.IntegerField(null=True, blank=True)
    ref_y_psnr = models.DecimalField(null=True, max_digits=7,
decimal_places=2, blank=True)
    ref_u_psnr = models.DecimalField(null=True, max_digits=7,
decimal_places=2, blank=True)
    ref_v_psnr = models.DecimalField(null=True, max_digits=7,
decimal_places=2, blank=True)
    ref_yuv_psnr = models.DecimalField(null=True, max_digits=7,
decimal_places=2, blank=True)
    highmark_version = models.CharField(max_length=60, blank=True)
    def __unicode__(self):
                return self.test_name
    class Meta:
        db_table = u'testcase'

class Testsuite(models.Model):
    testsuite_id = models.AutoField(primary_key=True)
    profile = models.ForeignKey(Profile, related_name='profile')
    test = models.ForeignKey(Testcase, related_name='test')
    #def __unicode__(self):
                        #                       return
self.testsuite_id
    def __unicode__(self):
               return '%s,%s' % (self.profile, self.test)
    class Meta:
        db_table = u'testsuite'

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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