Nevermind, figured it out.

On Mar 8, 2:22 pm, krayel <jrta...@gmail.com> wrote:
> Right now I have model which is basically:
>
> class Student(models.Model):
>   name = models.CharField(max_length=150)
>   id = models.IntegerField(primary_key=True)
>
> and another model which refers to it:
>
> class ServiceHours(models.Model):
>   students = models.ManyToManyField(Student)
>   category = models.ForeignKey(Category)
>   hours = models.IntegerField()
>   date = models.DateTimeField(auto_now_add=True)
>
> Since every Student will also have their own User account, the student
> object is pretty much redundant as it only holds a name and id.
> Secondly, since the only thing that will eventually relate the two
> objects together is a student id/name match, and not an actual
> reference, the whole process may easily fail from human error
> (misspelling a name or id). Is there a way to create a ManyToManyField
> that refers to all Users? That way there would be less redundancy and
> names/ids need only be entered once thereby reducing the risk of a
> mistake in data entry.

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