Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Jan. 4, 2011 12:57:49

Santiago C.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

build application from admin code


Hello,

I just started using Django and I am still "marvelling at all the code
I didn't have to write". I wonder if this code, the admin interface,
could be used for the application itself. I would like to do something
like this:

Each user of my application gets his very own predefined objects of a
certain kind, which he can use, change, delete, and so on. He gets his
own urls and views that are but modifications of the automatically
generated admin urls and views. Like so:

example.org/juan/grammar/verbs/add/
(a modification of example.org/admin/grammar/verbs/add/)

or so:

example.org/merche/recipes/delete
(a modification of example.org/admin/recipes/delete)

Juan and Merche are users of example.org, but they can have and
administrate their own users. Juan, e.g., might have the users Maria
and EmacsGuru. Maria and EmacsGuru can only view and manipulate the
pages that Juan allows them to. And Juan can only view and manipulate
the pages that the admin of example.org allows him to.

Has anyone done something of this kind? Is there example code?

Santiago

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 Jan. 4, 2011 16:28:57

Shawn M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

build application from admin code


Now that you're luxuriating in the "done for you" aspect of Django, check out
the ModelForm object. It gives you the goodness you seek.

I don't think that setting up your URL system the way you describe is a good
idea. It's a complete security failure, so you'd have to handle permissions
anyway. Therefore, there's no benefit to having the username as part of the URL.

Shawn

On Jan 4, 2011, at 4:53 AM, Santiago Caracol wrote:

> Hello,
>
> I just started using Django and I am still "marvelling at all the code
> I didn't have to write". I wonder if this code, the admin interface,
> could be used for the application itself. I would like to do something
> like this:
>
> Each user of my application gets his very own predefined objects of a
> certain kind, which he can use, change, delete, and so on. He gets his
> own urls and views that are but modifications of the automatically
> generated admin urls and views. Like so:
>
> example.org/juan/grammar/verbs/add/
> (a modification of example.org/admin/grammar/verbs/add/)
>
> or so:
>
> example.org/merche/recipes/delete
> (a modification of example.org/admin/recipes/delete)
>
> Juan and Merche are users of example.org, but they can have and
> administrate their own users. Juan, e.g., might have the users Maria
> and EmacsGuru. Maria and EmacsGuru can only view and manipulate the
> pages that Juan allows them to. And Juan can only view and manipulate
> the pages that the admin of example.org allows him to.
>
> Has anyone done something of this kind? Is there example code?
>
> Santiago
>
> --
> 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.
>

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

Board footer

Moderator control

Enjoy the 24th of August
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support