I think all you would need to do is organize the permissions and
assign users to groups with the permissions need to access the various
views / data.

You could also easily make decorators for the view function. something
like @employee_login_required that checks if the user is loged in and
if the logged in user has the permissions to move on. If they don't
you just redirect them somewhere else or don't display certain links
in the template to get there ( both is probably the best option ).  or
check for is_staff  in the User object. or put a check for
is_employee

I don't think you would need to make a different permissions system,
you can create any number of permissions for any model and check for
them in your views and in templates. I would think this is all you
need to do. Make a permission can_view_stat_site, and check for it.
@permission_required('yourapp.can_view_stat_site')
def your_viewcode(self):
...

You can import your model into another just like any other python
module, But this would make your code less modular if that is what you
are going for. I think the primary problem here is you are trying to
build a site the same way you did with Zend, but in django (?)

On Nov 17, 4:54 am, zimnyx <zim...@gmail.com> wrote:
> Guys,
>
> I'm trying to lay out Django code for large "website", which consists
> of four subsytems:
> - employees' website
> - statistics website used also by employees
> - public website (with users accounts)
> - monitoring webservices
>
> This four components have different:
> - auth types,
> - different user types (employee account has really nothing to do with
> customer account)
> - different permission system
> - different webpage layout, css, media
> - different forms
>
> What is common between them:
> - they use the same database
> - most of models are shared between
> - global configuration (database uri, debug level, i18n, session etc.)
>
> In (for example) Zend Framework it's very easy to lay out:
> every subsystem is one ZF module and authentication is delegated to
> appropriate plugin based on detected module. Every module has its own
> controllers (Django views) + helpers, templates etc. Models connected
> with specific module are stored within module directory, and "global"
> models are available for all ZF modules. All rocks in a minute, code
> has very readable structure.
>
> Can Django handle such modular code layout?
> What's your advice?
>
> Cheers,
> Piotrek

--

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=.


Reply via email to