It is also worth noting that the "view-only" version of the user profile is basically a copy of the "form" version.
(I don't mean "view-only" in the sense of making input fields read- only. "View-only" means no submittable form, just the data displayed.) On Apr 11, 3:32 am, jmswen <jms...@gmail.com> wrote: > Hi all, > > I'm creating basic user profile functionality. I have a class, > UserProfileForm, that extends ModelForm, and this is great. I can add > a piece of data (e.g., favorite candy bar) to the UserProfile model, > and I don't have to make any changes to the UserProfileForm or the > corresponding template in order to get "Favorite candy bar" to appear > on the form. This is great, adheres to DRY, yada yada yada. > > User A may edit his profile using a UserProfileForm, but User B will > have to view User A's profile through a completely separate view, > template, etc. > > Now, here is my problem. What's the best way to create the "view- > only, non-form" template and view for simply viewing other people's > profiles? I want to repeat myself as little as possible. For > example, if I eventually decide to add "Favorite candy bar" to a > user's profile, then I shouldn't have to go into any templates to add > a corresponding row- it should read my mind. > > I hope this question is somewhat clear. I imagine many people must > have run into similar problems. -- 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.