| Name | N8 |
|---|---|
| Email Address | n/a |
| Posts | 7 |
-
- 2010-09-20 13:41:12
- Re: Display ForeignKey relation in admin view Inline (Nested Inline in django admin)
- Board » Django Standard Library » Admin
-
I found some more info on this, nested inlines in django admin are not only a problem for me: http://code.djangoproject.com/ticket/9025
I will try now to use EasyMode (http://github.com/LUKKIEN/django-easymode) because it contains apparently "Admin support for model trees with more than 2 levels of related items" : http://packages.python.org/django-easymode/tree/index.html
If someone knows a more direct or elegant way please share!
-
- 2010-09-20 11:50:49
- Display ForeignKey relation in admin view Inline (Nested Inline in django admin)
- Board » Django Standard Library » Admin
-
in the admin view of one model, I have an inline display of a second model which contains a foreignkey to the first model. A third model contains a foreignkey to the second model, how do I display these in the same admin view inline of the second model? (I think with a callable within a list_display of some sort, but Im a novice and havent gotten that to work).
To clarify:
So with three models: Company, Location, Content
And a foreign key relationship like so:
class Location(models.Model):
...
company = models.ForeignKey('Company')
...
class Content(models.Model):
...
location = models.ForeignKey('Location')
...
in admin.py for the application:
class LocationInline(admin.TabularInline):
model = Location
class CompanyAdmin(admin.ModelAdmin):
inlines = [
LocationInline
]
Problem: How do I make the Content associated with each Location appear in the Inline list of Locations in the Company admin view?
I also have an inline for the Content model, which displays fine in the Location admin view. I would like to get a list_display of the locations' associated content relations in the Company admin view (in the Location inline). In the documentation it talks about making callables in the model, but Im missing an example to understand how to implement this.
--- Last Edited by N8 at 2010-09-20 13:37:11 ---
-
- 2010-09-09 09:30:37
- Re: Resources for Frontend dev
- Board » Django Standard Library » Authentication
-
Ok, yes I think I get the idea. Yea exactly, a user belongs only to one group, so the "mirror" option using a foreignkey relation seems like the way to go. Great, thanks for the advice, time to get crackin'.
-
- 2010-09-09 04:01:01
- Re: Resources for Frontend dev
- Board » Django Standard Library » Authentication
-
Well it seems I managed to figure it all out after much reading and trial and error, ah yes love the first feeling of Noob success
Perhaps I should make a new thread for this, but I will ask here while Im at it. Now I would like to make user groups, but not necessarily in the manner of group permissions. What I need to do is basically make a sub-set of users under a main user profile, where the admin will assign and associate content with a set users (ie a group). For example, the admin creates/selects a group in the backend, and uploads a static media file, associating it with the group. Then a user within this group logs on and may access the media file. An example application could be a chain of restaurants that share the same base content, but each individual restaurant has it's own user to access and edit the content to their specific needs.
Do you think I have to extend the user model to do this, or is there a way to make user groups or sub-users, or perhaps using django's group permission architecture can do this sufficiently?
-
- 2010-09-08 06:42:41
- Re: Resources for Frontend dev
- Board » Django Standard Library » Authentication
-
Thanks for quick reply Herbert! Yea, Im making progress with the django documentation, and even more so the django book http://www.djangobook.com/en/1.0/chapter12/. Just looking for a something more tutorial-ish, since Im new at this. But I'll keep trudging along with the documentation, thanks again...
-
- 2010-09-08 04:55:06
- Resources for Frontend dev
- Board » Django Standard Library » Authentication
-
Newbie need stuff. I am working on my first django site, so far all“s been smooth following the tutorials, the admin backend is all good for now, and now Im working on user authentication. I followed this tutorial: http://codingnstuff.com/2010/01/create-your-user-management-frontend-in-django/ which was full of little errors, but i managed to correct them for the most part. However, Im stuck on the user activation and login functions. I am looking for either simple tutorials or sample files to get me past these newbie hurdles. In other words, anyone have or know of other resources for creating a user authentication frontend? Of course Ive been going thru the documentation (http://docs.djangoproject.com/en/dev/topics/auth/), but an example of usage would really be nice to get me started.
Any advice would be much appreciated!
-
- 2010-09-08 04:41:08
- Site Search engine doesnt work?
- Board » General Category » General Discussion
-
Is it just me or does any search on this site turn up zero results? Lots of noo-B questions, so itd be nice to be able to search this forum....


