Re: shared application?

2008-11-24 Thread Haku

Sorry, my english didn't help me in explaining myself!

I have just one site with 2 applications
App A is something like "1st floor office documents"
App B is something like "2nd floor office documents"

This two applications are very different one from the other and are
reached with 2 different urls
mysite.com/1stfloor
mysite.com/2ndfloor

On the homepage of the site (mysite.com) there should be a "last
images" widget showing images from both floors, so i need a single
gallery application, but i also need to avoid people from the 1stfloor
to delete or edit images from the 2dnfloor. If make gallery available
from the admin and give permission to both the floors to publish and
edit it, anyone can do anything.

I hope you can understand me, my english is really bad

Maybe is just impossible to do what'm asking for :)

Thank you again

Alessio

On 24 Nov, 18:53, Jeff Anderson <[EMAIL PROTECTED]> wrote:
> Haku wrote:
> > Hi all, and please excuse me if i ask something obvious for you. I
> > can't get out of this problem!
>
> > I've got a site with 2 separate applications (call it A & B). Each one
> > has it's own administrators and there must be absolutely no
> > information passed from application A to application B and vice-versa.
>
> > Beside, i have a very simple gallery application. Administrators form
> > both applications (A and B) should upload images to the gallery, but A
> > should see only A's files and B only B's.
>
> > How can this be done with the administration site?
>
> It sounds like you have two different websites, but since you're asking
> the question I'm guessing that you want both applications on the same site.
>
> The way to do it is to use the permission system that comes with the
> Django auth/admin system. I've never implemented it myself, but it's all
> documented.
>
> You can also have multiple admin sites installed on different URL paths.
> Make one admin site for one app, and another admin site for the other.
> I've never done that either though, but it too is documented. :)
>
> Jeff Anderson
>
>  signature.asc
> < 1KVisualizzaScarica
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



shared application?

2008-11-24 Thread Haku

Hi all, and please excuse me if i ask something obvious for you. I
can't get out of this problem!

I've got a site with 2 separate applications (call it A & B). Each one
has it's own administrators and there must be absolutely no
information passed from application A to application B and vice-versa.

Beside, i have a very simple gallery application. Administrators form
both applications (A and B) should upload images to the gallery, but A
should see only A's files and B only B's.

How can this be done with the administration site?

Thank you for your help!

Alessio
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Internal server error upgarding from 0.97 to 1.0

2008-09-09 Thread Haku

Hello, i'm quite frustrated by this problem.
Today i had the  idea to update my svn from the old 0.97 to the 1.0
release, and now nothing is working anymore.

I always get an anonymous "Internal Server Error"
Maybe because my project included mptt, but the fact is that i cant
figure out why it is crashing. Seems like it's the slug fields but i
don't really know.

Is there a solution? Or maybe, how can i return to my loved 0.97
version?

Sorry for the dumb questions and the bad english!

--- IF THIS CAN HELP, THIS IS THE ERRORS I GET FROM THE LOG FILE
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython: Traceback (most recent
call last):
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/mod_python/apache.py", line 299, in
HandlerDispatch\nresult = object(req)
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/core/handlers/modpython.py", line 222,
in handler\nreturn ModPythonHandler()(req)
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/core/handlers/modpython.py", line 195,
in __call__\nresponse = self.get_response(request)
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/core/handlers/base.py", line 67, in
get_response\nresponse = middleware_method(request)
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/home/django/
intranet_pini/../intranet_pini/middleware/threadlocals.py", line 12,
in process_request\n_thread_locals.user = getattr(request, 'user',
None)
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/contrib/auth/middleware.py", line 5, in
__get__\nrequest._cached_user = get_user(request)
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/contrib/auth/__init__.py", line 83, in
get_user\nuser_id = request.session[SESSION_KEY]
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/contrib/sessions/backends/base.py",
line 46, in __getitem__\nreturn self._session[key]
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/contrib/sessions/backends/base.py",
line 172, in _get_session\nself._session_cache = self.load()
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/contrib/sessions/backends/db.py", line
16, in load\nexpire_date__gt=datetime.datetime.now()
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/db/models/manager.py", line 93, in get
\nreturn self.get_query_set().get(*args, **kwargs)
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/db/models/query.py", line 297, in get
\nclone = self.filter(*args, **kwargs)
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/db/models/query.py", line 483, in filter
\nreturn self._filter_or_exclude(False, *args, **kwargs)
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/db/models/query.py", line 501, in
_filter_or_exclude\nclone.query.add_q(Q(*args, **kwargs))
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/db/models/sql/query.py", line 1224, in
add_q\ncan_reuse=used_aliases)
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/db/models/sql/query.py", line 1099, in
add_filter\nnegate=negate, process_extras=process_extras)
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython:   File "/usr/lib/
python2.4/site-packages/django/db/models/sql/query.py", line 1275, in
setup_joins\nfield, model, direct, m2m =
opts.get_field_by_name(name)
[Tue Sep 09 19:35:43 2008] [error] [client 192.168.0.101]
PythonHandler django.core.handlers.modpython: 

User is in models.py

2008-07-08 Thread Haku

Hello all!
Is it possible to find out current user id form "myapp/models.py" file
so i can customize the way it is saved from the admin interface?

I'd like to do something like

class Myapp(models.Model):
...
...
def save(self):
if user.is_superuser:
dosomethinghere()
super(Myapp, self).save()

I've noticed that django saves an history of the changes occurred to a
any row in myapp table, so i think it should be easy to find out
current user.

Thanks in advance!
Haku!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Approvation by superuser

2008-07-07 Thread Haku

Hello!
I'm a big django superfan, i just love it!

I'm trying to find a solution to my problem, but no luck or (maybe)
I'm too dumb to find it by myself. Anyway, what if i need to set up
some kind of "superuser approval system"?

For example, I want my publisher to write and article, which will be
stored in the db as "unapproved" and than I want my superuser to read
it and approve if it's good, so it can be viewed on the site only
AFTER the approval stuff.

Any suggestion (if not solution ;-) ) would be greatly appreciated!

Thanks again, sorry for my italian-english, and keep on the great
work!

Alessio
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



How to add a custom filter?

2007-07-27 Thread Haku

I'm quite new to python and django.

How can i add a custom filter? I've found one that i need (
http://www.djangosnippets.org/snippets/192/ ) bt i dunno how to use it.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Table shared by 2 application

2007-07-09 Thread Haku

Ok, thank you KpoH!
This is cool!

Haku


On 9 Lug, 17:15, KpoH <[EMAIL PROTECTED]> wrote:
> mistype
>
> from your_project.apps.forum.models import Forum
>
> KpoH пишет:
>
>
>
> > example:
>
> > apps/manage/models.py
>
> > from django.db import models
> > from your_project.apps.models import Forum
>
> > class ForumManager(models.Model):
> > forum  models.ForeignKey(Forum)
> > ... and so on
>
> > but model Forum will be in
>
> > apps/forum/models.py
>
> > Haku writes:
>
> >> Hi all, this is my second help request in the ML, sorry i i'm wrong
> >> with something!
>
> >> I have a question:
> >> Suppose i need a db table named "users".
> >> Now, this table should be used by 2 aplication of my site: "forum" and
> >> "Manage".
>
> >> How can i do it? I mean, where i define the table in "Forum" or in
> >> "Manage"?
> >> And how to set the sharing?
>
> >> Sorry for my ugly english!!
>
> >> Thnx in advance.
>
> >> Haku
>
> --
> Artiom Diomin, Development Dep, "Comunicatii Libere" 
> S.R.L.http://www.asterisksupport.ruhttp://www.asterisk-support.com


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Table shared by 2 application

2007-07-09 Thread Haku

Hi all, this is my second help request in the ML, sorry i i'm wrong
with something!

I have a question:
Suppose i need a db table named "users".
Now, this table should be used by 2 aplication of my site: "forum" and
"Manage".

How can i do it? I mean, where i define the table in "Forum" or in
"Manage"?
And how to set the sharing?

Sorry for my ugly english!!

Thnx in advance.

Haku


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: documentazione django

2007-05-04 Thread Haku

Ciao.
Che io sappia no, ma c'è un gruppo italiano :)

http://groups.google.com/group/django-it?lnk=li

Ciao!

On 4 Mag, 17:45, mardif <[EMAIL PROTECTED]> wrote:
> ciao a tutti,
>   volevo chiedere se qualcuno sa dirmi se esiste della documentazione
> di django in italiano, e se si, dove trovarla.
>
> grazie


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Apache + mod_python problem

2007-05-04 Thread Haku

Ok, i've solved the problem, wich was in the PythonPath (no "/mysite"
was needed :D )
But now i'm into another truble:
As i try to login into the admin, i alway get a message saying my
browser does not accepr cookies!!
But it isn't true!

Any suggestion?

On 4 Mag, 13:13, Haku <[EMAIL PROTECTED]> wrote:
> Ok, i'm here with another question :D
>
> Everithing is fine on my development server (windows), but now i want
> to put my project on my production server
>
> My production Server is a VPS running everithing django needs to run,
> so i've modified my httpd.conf file adding the following lines:
>
> 
> SetHandler python-program
> PythonPath "['/root/mysite'] + sys.path"
> PythonHandler django.core.handlers.modpython
> SetEnv DJANGO_SETTINGS_MODULE mysite.settings
> PythonDebug On
> 
>
> but as i restart apache and surf tohttp://urltoproducion/mysite/I
> always get this ugly page with this ugly error:
>
> EnvironmentError: Could not import settings 'mysite.settings' (Is it
> on sys.path? Does it have syntax errors?): No module named
> mysite.settings
>
> where am i wrong? I guess it's a path problem or something like
> that...
>
> Thank you!!!
>
> Haku


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Apache + mod_python problem

2007-05-04 Thread Haku

Ok, i'm here with another question :D

Everithing is fine on my development server (windows), but now i want
to put my project on my production server

My production Server is a VPS running everithing django needs to run,
so i've modified my httpd.conf file adding the following lines:


SetHandler python-program
PythonPath "['/root/mysite'] + sys.path"
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
PythonDebug On


but as i restart apache and surf to http://urltoproducion/mysite/ I
always get this ugly page with this ugly error:

EnvironmentError: Could not import settings 'mysite.settings' (Is it
on sys.path? Does it have syntax errors?): No module named
mysite.settings

where am i wrong? I guess it's a path problem or something like
that...

Thank you!!!

Haku


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Noob question about javascript files

2007-05-04 Thread Haku

OK, this works great!

Thank you very much!!!

On 4 Mag, 04:34, theju <[EMAIL PROTECTED]> wrote:
> Since Javascript is a static file you have to define your js directory
> in your urls.py. I've used a lot of Javascript Libraries and all have
> worked successfully.
>
> First in urls.py
>
> (r'^js/(?P.*)$', 'django.views.static.serve', {'document_root':
> '/media/agora/js/lib/MochiKit/'}),
>
> And then in your templates
>
> 
>
> It's going to work.
>
> -Thejaswi Puthrayahttp://thejuhyd.blogspot.com


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Noob question about javascript files

2007-05-03 Thread Haku

Ok, i'm really sorry to bug you with this noobish question... but i
can't get out this mess alone.
I'm coming from php and i'm still learning Django and Python.

So, my problem is the following.
I've got a simple app called "agora" (which is a simple blog) and all
works great! but now I'm trying to use mochikit as i always did, but
it doesn't works!

The only way to make mochistuff ok is to give the absolute path to the
stati media files, like this:

http://xxx/media/agora/js/lib/</a>
MochiKit/MochiKit.js">

But in this way i can't use my aptana to work with the project... So,
i'm in a big truble.

I'm using Eclipse/Pydev/Aptana.

Can someone explain me how to setup my projects in order to work with
this tools the right way?

Thanks in advance and sorry for my english!!

Haku


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---