If you are using the default django admin, you can use inline model
admins [1]. The django's tutorial covert this point with polls'
questions having many possible choice in part 7 [2]

[1] 
https://docs.djangoproject.com/en/1.10/ref/contrib/admin/#inlinemodeladmin-objects
[2] 
https://docs.djangoproject.com/en/1.10/intro/tutorial07/#adding-related-objects

2016-11-06 15:11 GMT+01:00 ronronald97 via Django users
<[email protected]>:
> Hi,
>
> I am rather new to django and not sure how to set up the relationship for
> all the fields of a resume app.
>
> Let's say each user can have 1 or more resume. In each Resume, there is a
> introduction/about, 1 or more education entries and 1 or more previous job
> entries.
> Is this correct?
>
> class Resume(models.Model):
>     about = models.TextField(max_length=500)
>     applicant = models.ForeignKey(User)
>
>
> class Education(models.Model):
>     school = models.CharField(max_length=100)
>     course = models.CharField(max_length=100)
>     Resume = models.ForeignKey(Resume)
>     start_date = models.DateField(blank=True, null=True)
>     end_date = models.DateField(blank=True, null=True)
>
> class Job(models.Model):
>     title = models.CharField(max_length=100)
>     company = models.CharField(max_length=100)
>     Resume = models.ForeignKey(Resume)
>     start_date = models.DateField(blank=True, null=True)
>     end_date = models.DateField(blank=True, null=True)
>
> What should I do in the view or form to let user to add more education or
> job fields?
> Or I could only set it up certain amount of entries for each model, for
> example 3 eduction entries and 5 previous jobs.
> Is there anyway I can do that dynamically so I can just start with 1 for
> each model and let the user add more if they need to?
>
> Thanks
>
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> 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/c23fc997-b723-4987-9be7-eb352f88814b%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/CAEuG%2BTaP3P2d5syLtaR%2Bj%2BeGXs4PW%2BWBOUXcA4ws%2BQuozOonww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to