Hi all,

This is totally a beginner question and if this is the incorrect forum for 
this type of question please let me know!

So I have a couple questions. 
First I have two models 

a Student (as a signup)
a Class (as a Elective) 

What is the correct way to associate nth amount of students to a class? 
Also after I associate a list / dict (or whatever we decide here), would 
adding logic as a max limit of students be added to my Elective controller 
class? Or would the logic of "Max students" in a Elective instance be 
better contained in m elective class? 
Would I use a constructor with methods in my model to check? 

here are the models for contex (still in progress) 

# Create your models here.

class SignUp(models.Model):
    first = models.CharField(max_length=25, null=True, blank=False)
    last = models.CharField(max_length=25, null=True, blank=False)
    studentID = models.CharField(max_length=6, null=True, blank=False)
    gradeChoice = models.CharField(max_length=2, choices=grd, default='1')
    genChoice = models.CharField(max_length=2, choices=gender, default='1')
    timestamp = models.DateTimeField(auto_now_add=True, auto_now=False)
    update = models.DateTimeField(auto_now_add=False, auto_now=True)

    def __unicode__(self):
        return smart_unicode('Student: ' + self.last + ', ' + self.first)


class Elective(models.Model):
    title = models.CharField(max_length=25, null=True, blank=False)
    description = models.CharField(max_length=500,null=True, blank=False)
    tFname = models.CharField(max_length=25, null=True, blank=False)
    tLname = models.CharField(max_length=25, null=True, blank=False)

    def __unicode__(self):
        return smart_unicode('Class Name:: ' + self.title)



Please let me know of you have any questions. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8fcda355-ec6a-4baf-8b46-88c352422e13%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to