Re: Why does django use mysqldb over mysql-connector?

2012-05-04 Thread john2095
My frustration was borne by the ease with which Debian makes the task: I 
did expect the job to be an insignificant one-line command. Thanks Tom. 
Apple don't see a profit in providing a mysql-client package.  Ramiro has a 
point that lobbying MySQL for a client-only OSX package is a righteous 
path. Thanks Ramiro.

But at the end of the day we can't expect everyone else to do everything 
for us.  I'm now dreaming of a week or two with nothing to do but put time 
into one of those abandoned starts at a django-mysql-connector.  Thanks 
Masklinn.

I think you've all answered my questions.

1) It's happened by design; mysqldb is mature, stable and omnipotent; 
mysql/oracle and apple are unmotivated.
2) No-one is currently working on removing the dependency.  There are only 
a couple of false starts to date.

cheers,
John.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/qJdncQs9gQ8J.
To post to this group, send email to django-users@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.



Re: Why does django use mysqldb over mysql-connector?

2012-05-04 Thread john2095
Oh. Thanks Kurtis. That answers the first question: it's built on mysqldb 
primarily because it's mature and stable. Thanks.

As for the second question: has anyone tried building a backend on 
mysql-connector yet?  Silence?  Is this an opportunity?


On Friday, 4 May 2012 16:53:43 UTC+10, Kurtis wrote:
>
> I think what he was trying to get at is that the Python MySQL Adapter is 
> in early stages of development where-as Django is depended upon to be a 
> very stable platform/framework. It would be great to have the option to use 
> that adapter though for situations like yours.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/e0SPHkOwVrwJ.
To post to this group, send email to django-users@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.



Re: Why does django use mysqldb over mysql-connector?

2012-05-03 Thread john2095
Yes, that's the pure python adapter I'm talking about.  I think that's 
effectively the same as this 
one. 
 Nice link but I'm not sure if you're suggesting that as additional 
information or an answer?

The question remains is a compelling reason why "django.db.backends.mysql" 
is built upon mysqldb  with 
dependencies rather one without dependancies, and if anyone has attempted 
to implement an equivalent "django.db.backends.mysql" with the latter.


On Friday, 4 May 2012 11:30:31 UTC+10, steev wrote:
>
> > Has this happened by default or by design?  Is mysqldb really that much 
> > faster, or featureful, or just because it's more common? 
>
> From http://forge.mysql.com/projects/project.php?id=302 
>
> "Development Status: Early (Pre-Alpha)" 
>
> -- 
> steve 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/xLS_rF0bi_gJ.
To post to this group, send email to django-users@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.



Why does django use mysqldb over mysql-connector?

2012-05-03 Thread john2095
I've just been through a slice of hell simply because I did not want to 
install mysql-server on my (osx) django development machine - my app 
connects to a remote mysql database.  It turns out that python's "mysqldb" 
depends on mysql binaries which are only packaged up with the server 
release.  This means that if you want to run django and connect to a remote 
mysql you still need to install mysqlserver locally.  I think that 
blows. Especially when there is a purely python mysql driver in 
"mysql-connector".

Has this happened by default or by design?  Is mysqldb really that much 
faster, or featureful, or just because it's more common?

Is anyone working on a pure python solution (mysql-connector) database 
backend? Is there one already?

thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/eyGNf1RsLEsJ.
To post to this group, send email to django-users@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.



Re: Multiple tables, is Django suited for this?

2010-03-30 Thread john2095
Not impossible at all. Just a lot of work :-)

You'd have to build and maintain a little model generator script to
detect a new table, determine its schema, and generate the models.
Then what? Your application detects new models appearing and can
autonomously decide what to do with each one?  Sounds difficult (ie:
expensive) to build because those bits would need to be entirely
abstract.

Django can handle being told what the names of the tables are (class
Meta deb_table = ) no problem.  But given, the scope and
dynamism of your described problem, it does sound like you'll be
working against the grain: Any ORM, a db abstraction, does like to
assume ownership of the underlying db, and it will typically resist
outsiders seeking to dictate its internal affairs.



On Mar 30, 8:48 am, Matthias  wrote:
> I'm relatively new to the Django world and I'm just starting on a new
> project that may be right up the frameworks ally.  But there's one
> thing I'm a little iffy on after reading the documentation.
>
> I'm attempting to write an app that will allow for management of a
> "parts" database that will allow for parts to be added with a couple
> auto-generation features.  The parts database I wish to edit is
> maintained by a separate program called Altium, so the structure of
> the database is pretty rigid, and the way it's set up is it creates
> Tables for classes of parts (so all capacitors that are of size 0805
> will be found in the table, CAPS_0805).  These tables are frequently
> created as we run across a new class of part.  So the names of the
> tables that this app would be editing are far from static.  It would
> appear using the Models system of Django the tables which I could
> setup all of Djangos magic on are pretty rigidly named (aka, I can't
> just use some variable name to represent the table).
>
> The only solution I see right off to this would be to create a chron
> job that would edit the models file for me after checking the database
> (automatically creating models for each of the tables).  I feel like
> this is a hack to something that shouldn't really need one.  Also,
> then I think I would have to use dictionaries if I wanted to treat the
> table names as variables in the program which looks ugly.  (The user
> will for example select which table the part needs to go in from a
> drop down menu).
>
> Any insight here would be much appreciated.
>
> Thanks,
> Matthias Welsh.

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



Thanks for upload_to=

2010-03-30 Thread john2095
Just a little shout out to the development team for anticipating my
need and coming up with this little gem.

To keep the long story short I spent the entire day trying work out
how I was going to save a file somewhere in the filesystem with a file
path determined by the properties of the model.  Did someone say 'wild-
goose-chase'. I examined, in detail, the  inheritance tree trying to
work out where would be the most appropriate to jump in...

models.Model?
ImageField?
FileField?
Storage?

After banging away at your documents server all day, I've finally
discovered it:

FileField.upload_to:
   ...
   This may also be a callable, such as a function, which will be
called to obtain the upload path, including the filename.

Oh! Two lines later and I'm done.

Gratitude.

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



Re: What validation tests are applied to ImageField?

2010-03-22 Thread john2095
Thanks Tom.  I don't know where it comes from but it seems deeply
ingrained for me to expect the model to enforce the atomicity/
integrity of its objects.

Just for anyone who stumbles over this thread and wants to know how it
ends...

In this application I'm not using a form (uploadify is a flash-based
file sender) but I can still take advantage of the django.forms
validation routines by invoking ImageField without a form. This seems
to work:

def upload(request):
from django.forms import ImageField, ValidationError
try:
photo = ImageField().clean(request.FILES['Filedata'])
except ValidationError:
return HttpResponse("I don't think that's an image.")




On Mar 22, 9:04 pm, Tom Evans <tevans...@googlemail.com> wrote:
> On Mon, Mar 22, 2010 at 6:51 AM, john2095 <john...@pobox.com> wrote:
> > But does this all amount to an expectation that it will restrict the
> > upload to an image??
>
> > I've got this in my model:
>
> > class Photo(models.Model):
> >    image = models.ImageField(upload_to='photos')
>
> > and this in my view:
> >    try:
> >        p = Photo()
> >        p.image = request.FILES['Filedata']
> >        p.save()
> >        return HttpResponse('OK')
> > ...
>
> > Yet if I do this:
>
> > curl -F fileda...@nasty.exehttp://mysite/photo/upload/
>
> > It seems quite happy to save the .exe
>
> > Can someone please confirm the same test result?   I wouldn't like to
> > say "security advisory" prematurely.
>
> > Thanks.
>
> Models don't have validation, forms have validation. If it passed
> through a forms.ImageField it would get rejected as invalid.
>
> Cheers
>
> Tom

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



Re: Remove session on browser close

2010-03-22 Thread john2095
I think the proper paradigm is to use the AnonymousUser.

Rather than trying to destroy the session - something that cannot be
reliably achieved - instead set the user of the session back to
AnonymousUser and test/react to that.


On Mar 23, 8:40 am, grimmus  wrote:
> Basically all i want to do is the following :
>
> Have a newsletter signup form. When the user signs up successfully the
> area where the form was has a thanks message instead of the form.
>
> The form or thanks message is displayed on every page of the site, so
> I thought using a session would be the best way handle whether to show
> the form or the thanks message.
>
> Here is my form
>
> 
>                 
>                     {% if form.errors %}
>                     Please enter a valid email address.
>                     {% endif %}
>                     {% if form.thanks %}
>                     Thanks for signing up
>                     {% endif %}
>                     {% if form.alreadyexists %}
>                     The email address already exists
>                     {% endif %}
>                     {% if not form.thanks %}
>                        value="Email
> address" onfocus="this.select()" />
>                        value="Go"/>
>                     {% endif %}
>                 
>               
>
> And my view
>
> if request.POST:
>         form = SignUp(request.POST)
>
>         if form.is_valid():
>
>             email = request.POST.get('email', '')
>
>             try:
>                 entry = MailingList.objects.get(email=email)
>
>                 form.alreadyexists = True
>
>             except (KeyError, MailingList.DoesNotExist):
>
>                 entry = MailingList()
>                 entry.email = email
>                 entry.date_added = datetime.now()
>                 entry.save()
>
>                 request.session['signed_up'] = True
>                 form.thanks = True
>
>             return HttpResponseRedirect(request.get_full_path())
>
>         else:
>             print form.errors
>
>     else:
>
>             form = SignUp()
>
>             t = loader.get_template('home/page.html')
>             c = RequestContext(request,{
>                 'form':form,
>             })
>
>             if request.session.get('signed_up', True):
>                 form.thanks = True
>
>             return HttpResponse(t.render(c))
>
> Any help is greatly appreciated.
>
> On Mar 22, 3:13 pm, Bill Freeman  wrote:
>
>
>
> > And if the user disables javascript, or kills the browser without
> > normal exit, or loses
> > his connection, or pulls the ethernet cable, or has a power failure?
>
> > On Mon, Mar 22, 2010 at 10:06 AM, Wiiboy  wrote:
> > > Couldn't you use Javascript for this? For example, on the
> > > onbeforeunload event, delete the sessionid cookie?
>
> > > --
> > > 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.

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



Re: What validation tests are applied to ImageField?

2010-03-22 Thread john2095
But does this all amount to an expectation that it will restrict the
upload to an image??

I've got this in my model:

class Photo(models.Model):
image = models.ImageField(upload_to='photos')

and this in my view:
try:
p = Photo()
p.image = request.FILES['Filedata']
p.save()
return HttpResponse('OK')
...

Yet if I do this:

curl -F fileda...@nasty.exe http://mysite/photo/upload/

It seems quite happy to save the .exe

Can someone please confirm the same test result?   I wouldn't like to
say "security advisory" prematurely.


Thanks.


On Mar 18, 9:42 pm, john2095 <john...@pobox.com> wrote:
> Perfect. Thanks. That's what I was chasing.
>
> On Mar 17, 11:54 pm, Karen Tracey <kmtra...@gmail.com> wrote:
>
>
>
>
>
> > Validation of image fields is done at the form field level, see:
>
> >http://code.djangoproject.com/browser/django/trunk/django/forms/field...
>
> > Karen

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



Re: Multiple polls on a single form

2010-03-18 Thread john2095
Sounds like you're building a "multiple choice questionnaire".

Googling around everyone seems to be indicating the perfect blog post
for you was at:
http://www.pointy-stick.com/blog/2009/01/23/advanced-formset-usage-django/
but the site seems to have dropped off the internet. At the end of the
day I'd say you've got a learning curve in front of you. First forms,
then formsets, then validating them.

Enjoy.


On Mar 18, 7:26 pm, ALJ  wrote:
> I have a list of questions and for each a group of potential answers.
> I want to display the questions and have radio buttons for answers. In
> addition, if they have any other comments, there is a free text box.
> I've managed to do this ok so far excluding the comment boxes and can
> iterate over the questions and answers and pull them into the
> database. I can also re-populate the form if they decide later they
> need to change the answers. I'm now trying to look at checking for
> errors.
>
> However, I haven't been using any of the form or formset classes. It's
> all very much written from scratch and I have to do a number of these
> (all with slightly different layouts of course). I therefore wondered:
>
> - has anyone else done anything similar to this?
> - are there any examples of how to do it?
>
> (I'm not even sure what to call this so I can search for myself.)
>
> ALJ

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



Re: What validation tests are applied to ImageField?

2010-03-18 Thread john2095
Perfect. Thanks. That's what I was chasing.

On Mar 17, 11:54 pm, Karen Tracey  wrote:
>
> Validation of image fields is done at the form field level, see:
>
> http://code.djangoproject.com/browser/django/trunk/django/forms/field...
>
> Karen

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



Re: Form validation changes since 1.1.1? (Autocomplete errors)

2010-03-17 Thread john2095
There has been some change between 1.1 and trunk regarding questions
whether to enforce defaults at the form or the model level.  Might be
relevant, or provide a clue:
http://stackoverflow.com/questions/1436327/does-model-charfieldblankfalse-work-with-save

On Mar 17, 12:11 pm, Karen Tracey  wrote:
> Yeah but, if it worked previously under 1.1, it ought not be broken by
> updating to 1.2.
>
> Sounds like under 1.1 required=False on the form field overrode blank=False
> on the model field, whereas with the current trunk required=False on the
> form field is being ignored in favor of blank=False on the model field.
>
> It's probably worth opening a ticket; I don't recall hearing this reported
> before.
>
> Karen

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



Re: What validation tests are applied to ImageField?

2010-03-16 Thread john2095
> I assume Django is passing the file to PIL and asking if the file
> is in a format that PIL can deal with and is in a valid format.

My question is about the assumption...

As far as I can find, it actually only uses PIL to read the file and
return the dimensions.  The code looks like if PIL throws an error
because it can't parse the file then the error will be ignored. I'll
have to rig up a test to see what really happens here.  See:

http://code.djangoproject.com/browser/django/trunk/django/core/files/images.py#L35

I can't find another usage. At this point, I suspect that if any
errors pop up they are the side-effect of trying to establish the
dimensions and not any specific attempt to validate the image against
a set of criteria.

For those who missed it my question it was:

What constitutes a 'valid' image?
The documentation states "ImageField... Like FileField, but validates
that the uploaded object is a valid image."

Maybe I should post this on the developers list? Would that upset
them?

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



What validation tests are applied to ImageField?

2010-03-15 Thread john2095
The documentation states about the ImageField

"Like FileField, but validates that the uploaded object is a valid
image. Has two extra optional arguments:"

http://docs.djangoproject.com/en/dev/ref/models/fields/#imagefield

I went cruising the source to try and work out what tests are
implemented to define "a valid image" but didn't get much
satisfaction. There seemed to be a fair bit of talk about dimensions
but nothing about much else.  I was thinking/hoping to find something
which inspected the binary stream to ensure the .jpg/.gif/.png/.bmp
fit its applicable formats.

Question is "What is the definition of a 'valid image'" in this
context?"
and, optionally, where is the source code for that?

t.i.a.

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



Re: Cron vs event triggered action

2009-12-15 Thread john2095
Just to throw it out there... forget about trying to make something
happen every ten minutes; or whatever your margin for error is.
Instead focus on just testing to see whether two hours have passed
when you come to use it. Either lazy (C), or diligent (D)...

Solution C:
Do nothing at all until someone comes asking for it: Have two hours
passed since the create_time? Yes. Trash. Sorry, you were too slow.

Solution D:
Every time someone comes asking for that object: Wait, let me just
trash everything i have which is over two hours old... ok. Now may I
help you? Oh, I'm sorry I don't have that anymore, maybe it expired.

(C) could lead to lots of dead stuff lying around whereas (D) could
lead to a lot of unnecessary overhead.
But for lightly loaded apps they'll do the job without the hassle.

Just for fun.

On Dec 13, 9:58 am, Tim Daniel  wrote:
> Just want to figure out if there is a smarter solution for handling
> the following problem:
>
> 1. An action is performed by a user (Normal django behaviour handling
> a request and giving a response).
> 2. Two hours later I want an automatic action to be done.
>
> Solution A: Have a datetime field with an expiry date and say every 10
> minutes a cron job checks the DB table for expired entries and
> performs the programed action.
>
> Solution B: Have an event triggered cronjob that only executes once
> and is created from Django(Python), after the 2 hours passed it
> performs the programmed action only on the required entry.
>
> So how can I implement solution B? Is there a posibility to create a
> cron on a user action that executes only one time?
>
> NOTE: I don't want to rely on a thread that should stay alive for two
> hours ore more inside the server memory.

--

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.




Re: Understanding of File Upload in Django

2009-12-15 Thread john2095
I'm confident people will correct my mistakes...

A file is transferred from a web browser to a web server by breaking
it up into packets at the network layer. Each packet is part of the
file and you need the complete set of packets to recreate the whole
request, and thus the whole file.  Assuming you're using the default
backend, as each packet arrives it is placed into memory whilst we
wait for the rest of the packets to arrive.  This the uploading
process.

When all the packets of the HttpRequest have arrived and are in
memory. Then your code is executed and you can elect to do whatever
you like with the data sitting in memory, like write it to disk. That
would be the saving part.

But that was the default behaviour.  If you want something different
to happen, you can use a different backend, or even build your own
backend.  For example you won't have to look too far before finding a
backend which writes the "chunks" of the data directly to disk as they
arrive, rather than waiting for them to be marshalled in memory.

Whether you get preferred results by writing to memory or to disk is
entirely subjective upon your application and hardware.  If you expect
a lot of people to be uploading a lot of very large files
simultaneously, and your server has very little memory, then you might
find writing directly to disk is preferable; but the default is the
default because that works best for most subjects.


On Dec 14, 5:55 am, sjtirtha  wrote:
> Hi,
>
> can somebody explain me how file upload works in Django?
> I read this 
> documentation:http://docs.djangoproject.com/en/dev/topics/http/file-uploads/
>
> And there is this part:
> ###
> Where uploaded data is
> stored¶
>
> Before you save uploaded files, the data needs to be stored somewhere.
>
> By default, if an uploaded file is smaller than 2.5 megabytes, Django will
> hold the entire contents of the upload in memory. This means that saving the
> file involves only a read from memory and a write to disk and thus is very
> fast.
>
> ###
>
> What does it mean by "saving the file involves only read from memory and a
> write to disk..."?
> I though uploading and saving a file are one process. When I upload a file
> by submiting my form it means it will also save the file somewhere.
>
> But what I understand from the documentation is uploading and saving are two
> different processes. How can I trigger the saving then?
>
> Regards,
>
> Steve

--

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.




Re: How to lay out large, *modular* website in Django.

2009-11-17 Thread john2095
Yes.  Django is python and python can handle a modular layout. But
it's not PHP/Zend.  You will have to entirely rewire your brain by
learning Python. There is a respectable curve to climb if you're
coming from PHP.

But to give you some comparison I have about 8 months experience with
django (and a lifetime of programming) and, very recently, to achieve
a similar goal to yours - separate, isolated authentication entry
points - i've managed to cut/paste/rewrite the contrib.auth in, say,
30 hours.  The result uses our models - not joined to auth_user -, is
keyed by email address rather than username, and shares nothing with
an administrator's session  - so different user/pass, reauth if you go
from one 'site' to another.  I expect it will take me another 20-30
hours to bed down the suite of decorators for the permissioning model
we're looking for.

Maybe that helps.

On Nov 18, 7:57 am, "esatterwh...@wi.rr.com" 
wrote:
> 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  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=.