Opened 19 years ago

Closed 19 years ago

#678 closed enhancement (fixed)

I would like to see a tutorial describing how to edit One-To-Many relationships

Reported by: Ian@… Owned by: Jacob
Component: Documentation Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The current 'polls' tutorial is GREAT, and it REALLY helps new users come up to speed quickly. I love the style it is presented in.

Currently the tutorial skips one important task. Creating a one -> many entry screen (ie the page to create a poll with multiple choices on it). It 'cheats' and goes to the command line/admin screens to do these.

I would like to see a tutorial on how to do this. I belive the tutorial would cover a lot of material that I have issues with, and would go into detail on how the framework behaves.

regards
Ian.

Change History (6)

comment:1 by Adrian Holovaty, 19 years ago

Resolution: invalid
Status: newclosed

Maybe I'm not understanding you correctly, but the tutorial does indeed cover how to edit one-to-many relationships in the admin. Check out the section that starts "But, really, this is an inefficient way of adding Choice objects to the system."

Here's the image: http://media.djangoproject.com/img/doc/tutorial/admin11.png

Please reopen if I'm misunderstanding you.

comment:2 by anonymous, 19 years ago

Resolution: invalid
Status: closedreopened

hi Jacob.
I meant how to build a form to do this.
(not do it via the admin interface)

comment:3 by rjwittams, 19 years ago

I think you want to do inline editing outside the admin?
This is pretty broken in trunk. Use new-admin to do this.

See NewAdminChanges.

I agree that after new-admin is merged it would be a good
idea to have a tutorial on this.

comment:4 by ian@…, 19 years ago

Thanks rj.
I switched to new-admin, and I can now see this as my form object

{'error_dict': {}, 'manipulator': , 'data': {'contact.1.id': None, 'contact.0.tags': [16, 19, 20, 21, 22], 'name': 'Ian Holsman', 'contact.0.email': 'page-ianh@example.com', 'id': 1, 'contact.1.email': '', 'contact.0.id': 5}, '_inline_collections': [], 'edit_inline': True}

but I have no idea how to show this in my template ;(

comment:5 by rjwittams, 19 years ago

Sorry, I should have covered this properly in new-admin changes. Will do so, however, a quick example is:

{% for contact in form.contacts %}

{% contact.id %}
{% contact.name %}
{% contact.email %}

{% endfor %}

I will also think about how to make the repr mor informative....

comment:6 by anonymous, 19 years ago

Resolution: fixed
Status: reopenedclosed

perfect.
Thanks RJ.
I'll mark it as fixed

Note: See TracTickets for help on using tickets.
Back to Top