Announces django-guardian 1.0.0.pre

2010-11-23 Thread lukaszb
Recently I've finally write down first part of integration with admin.
Positive side effect are reusable forms for object permissions
management.

There are still some caveats (i.e. queries number, not needed generic
fk with content_type, test runner and other small things) but they
should be removed before final release.

There is one "little" thing still left to be implemented - correlation
between normal and object permissions level. Russ cleared things up at
the last message at 
http://groups.google.com/group/django-users/browse_thread/thread/b54923791ed8d0d4.
This is also going to be written down before final release.

As always, any help pushing things forward is welcomed.

Try it, smash it and send feedback :)

PYPI: http://pypi.python.org/pypi/django-guardian/1.0.0.pre
Documentation: http://packages.python.org/django-guardian/
Github source page: https://github.com/lukaszb/django-guardian

-- 
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: auth user permissions

2010-11-19 Thread lukaszb
Try running "python manage.py syncdb". Hope that helps

On Nov 19, 2:00 pm, MikeKJ  wrote:
> I have forgotten something here, added a model to a site, restarted the
> server but the add/change/delete permission set is not showing in the
> auth-user add permission set, what is it I have forgotten please?
> --
> View this message in 
> context:http://old.nabble.com/auth-user-permissions-tp30257316p30257316.html
> Sent from the django-users mailing list archive at Nabble.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-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.



Announcing django-projector - django project management app with mercurial repositories support build-in

2010-09-05 Thread lukaszb
It took more time than I expected but there it is: project management
with repositories support.

So? What's in? Well, there is repository content browser, support for
mercurial push/clone over http, simple issue tracker (which have to be
revisited probably), members & teams, permissions etc. There are a lot
of features we haven't implemented yet or even stated (like code
review). Moreover, currently application doesn't support other scm's
but there is some work on the way to support git (we use
http://bitbucket.org/marcinkuzminski/vcs but both Martin and I haven't
worked on it much during the summer - Martin focused on his
http://bitbucket.org/marcinkuzminski/hg-app/src and I was working on
projector... and hey, it's summer!).

Website was launched today and is available at http://www.django-projector.org.
Documentation (http://packages.python.org/django-projector/) is still
rather basic and there are no buildout scripts yet so it may not be
straightforward how to deploy application.

Codes are available at http://bitbucket.org/lukaszb/django-projector/
and I plan to move them out at the https://forge.django-projector.org
but it depends on the feedback - I'm aware that it would be much
easier to collaborate at bitbucket right now.

I've also created mailing list here: 
http://groups.google.com/group/django-projector.

Oh, yep, there is a demo application. It was deployed at other
location a week ago but I've moved it to https://forge.django-projector.org
now. Anyone willing to check django-projector in action - just visit
the site, sing up and try it!

I'm aware of many issues - some of them are already stated at
http://bitbucket.org/lukaszb/django-projector/issues and some of them
not (like there is no option to allow anonymous/not members of public
projects to file a bug or Team conversion requires specific user
profile model). But according to publish-early-policy I've decided to
announce it anyway.

Motivation: github/bb are great services and it was something strange
to me that there are no open sourced similar projects (sure, there are
*plenty* of issue trackers with repository browsers, and only a few
rather still not deployable approaches to provide full repository
support). I've searched for application that integrates tightly with
scm - ended up with projector which provides bridge between django and
mercurial build-in server. I'm still unsure about git here, though -
and would gladly hear for any suggestions!

If you have any questions, please contact me at
lukaszbalcer...@gmail.com .

Regards,
Lukasz

-- 
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: PIL on 10.6 = PAIN

2010-09-02 Thread lukaszb
Hi,
I'd strongly advise to try homebrew instead of macports. You can find
it here: http://github.com/mxcl/homebrew .
After installation do: brew up && brew install jpeg and install PIL as
usual.
Since I needed freetype support I had to update PIL's setup.py
FEETYPE_ROOT: FREETYPE_ROOT = libinclude('/usr/X11')
[line 40 at PIL 1.1.7].

Currently I have no problem with PIL installation for every virtualenv
needing one.

Hope that helps if you can't stand ports etc anymore (I couldn't and
homebrew was quite a relief).

On Sep 1, 9:42 pm, keynesiandreamer  wrote:
> Well last night I started working on removing all traces of PIL and
> libjpeg as well as the install instructions from Andrews link (Thansk
> Andrew!)
>
> If there was a problem to encounter I seemed to hit it... :-(
>
> It all started when Git would not unzip, I finally got that with the
> xjvf flag I believe, and then now I get an error due to a dylib not
> being linked to x86_64 architecture. JESUS!
>
> I spent time trying to research that without much luck :(
>
> I upgraded the default mac installation python to python 2.6.6 and
> also am using virtualenv for my django envs and am having issues
> installing virtualenvwrapper, yet another install problem... Looks
> like something with the the source file and the virtualenv_bashrc
> file.
>
> Atleast in the morning my patience is a bit better... I will try
> hammering away at it again tomororw. I think I need a day off from it.
>
> Thanks everybody for all their insight and advice, it is very much
> appreciated. If you are anywhere near SF, there is beer on me for it.
>
> -Ben
>
> On Sep 1, 4:09 am, Mathieu Leduc-Hamel  wrote:
>
>
>
> > This is because you should not use the Python interpreter from you're
> > Mac installation. Are you using buildout ? VirtualEnv? or nothing ?
>
> > Buildout:
>
> > /opt/local/bin/python2.6 bootstrap.py
>
> > Virtualenv:
>
> > virtualenv -p /opt/local/bin/python2.6 
>
> > Nothing:
>
> > /opt/local/bin/python2.6 manage.py runserver
>
> > On Tue, Aug 31, 2010 at 9:40 PM, keynesiandreamer
>
> >  wrote:
> > > So I tried the Macports option and it started to look good, but then I
> > > got:
>
> > > --->  Installing py26-pil @1.1.7_1
> > > --->  Activating py26-pil @1.1.7_1
> > > Error: Target org.macports.activate returned: Image error: /opt/local/
> > > Library/Frameworks/Python.framework/Versions/2.6/bin/pilconvert.py
> > > already exists and does not belong to a registered port.  Unable to
> > > activate port py26-pil. Use 'port -f activate py26-pil' to force the
> > > activation.
> > > Log for py26-pil is at: /opt/local/var/macports/logs/
> > > _opt_local_var_macports_sources_rsync.macports.org_release_ports_python_py2
> > >  6-
> > > pil/main.log
> > > Error: Status 1 encountered during processing.
> > > To report a bug, see 
> > > Ben-Jammin-MacBook:~ martinek$ port -f activate py26-pil
> > > Warning: Failed to open Portfile from registry for py26-pil @1.1.7_1
> > > --->  Activating py26-pil
> > > Error: port activate failed: sqlite error: attempt to write a readonly
> > > database (8)
> > > Ben-Jammin-MacBook:~ martinek$ sudo port install py26-pil
>
> > > Sudo didn't work either
> > > :-(
>
> > > I am not even sure what DB is being discussed there...
>
> > > I also tried reinstalling PIL after the failure of MacPorts and
> > > something might have worked here. I don't get the same problem at the
> > > python prompt trying import _imaging
>
> > > Unfortunately Django/Pinax doesn't seem to see this after reactivating
> > > the ENV and restarting the server:
>
> > > BLurghh!!!
>
> > > Is it worth trying to remake the virtualenv I am working with? Would
> > > that help or is the problem still up the stream?
>
> > > -Ben
>
> > > On Aug 31, 11:49 am, keynesiandreamer 
> > > wrote:
> > >> Thanks Bill and Mathieu!
>
> > >> I will try the Mac port option first, in fact I did look at it last
> > >> night probably around 1am or so...
>
> > >> I treied rebuilding the virtual env I was using as well just to
> > >> verify, but the problem seem higher up the stream and Bill indicated.
> > >> I will take a look for the ld.conf equiv in OSX at lunch today.
>
> > >> Thanks!
> > >> Ben
>
> > >> On Aug 31, 10:20 am, Mathieu Leduc-Hamel  wrote:
>
> > >> > To work with PIL and other librairies a little bit weird and difficult
> > >> > to install the best way is to install Macport and after that:
>
> > >> > port install py26-pil
>
> > >> > and you'll need to use the python of the macport installation:
>
> > >> > $ /opt/local/bin/python2.6
>
> > >> > It's the samething on linux, i'm alway using the PIL package from my 
> > >> > distro...
>
> > >> > On Tue, Aug 31, 2010 at 7:10 PM, Bill Freeman  
> > >> > wrote:
> > >> > > This sounds more like libjpeg isn't on the library load path, a
> > >> > > system, rather than python, setting.
>
> > >> > > I haven't done this with a Mac, but PIL has been troublesome on *nix
> > >> > > servers for us as well

Re: Django on Mac OS X

2010-08-09 Thread lukaszb
I haven't read all the comments here but if you've just started
working on osx you should definitely check out http://github.com/mxcl/homebrew
- it's a package manager which works like a charm most of the time.

Installation is extremely simple (there is even one-liner available).
If your problem is related with wrong packages installation - homebrew
would most probably fix all of them, if only you can get rid of those
ports/finks at the first place.

Regards,
Lukasz

On Aug 9, 2:04 pm, Xavier Ordoquy  wrote:
> I doubt it's a mac issue.
> I already ran in a couple of very painful issues with postgresql on Linux 
> while having no issue with mysql on mac.
> My feeling is that postgresql require far more attention than mysql and is 
> more sensitive to small changes.
>
> Regards,
> Xavier.
>
> Le 9 août 2010 à 05:32, Daniel França a écrit :
>
>
>
> > I tried to reinstall everything... installing python+postgres from ports
> > and I get the Symbol not found: _PQbackendPID error again from psycopg.
> > I guess the best solution is run Ubuntu on a virtual machine or my project 
> > will be stuck forever.
> > python+psycopg on mac just sux.
>
> > 2010/8/8 Daniel França 
> > tried, nothing :(
> > I'm getting crazy with Mac OS, I think I'll go back to Linux :S
>
> > On Sun, Aug 8, 2010 at 4:34 AM, Xavier Ordoquy  wrote:
> > It won't work by commenting the timezone field since it has been created 
> > with a non null constraint on your db.
> > Have you tried to get_or_create the account with timezone and language set 
> > to some value ?
>
> > Regards,
> > Xavier.
>
> > Le 8 août 2010 à 04:09, Daniel França a écrit :
>
> >> More information.
> >> here:
> >> def create_account(sender, instance=None, **kwargs):
> >>     if instance is None:
> >>         return
> >>     account, created = Account.objects.get_or_create(user=instance)
>
> >> post_save.connect(create_account, sender=User)
>
> >> If I comment the post_save.connect, there's no exception =) but, of course 
> >> the code doesn't do what it should do.
>
> >> So, I don't know why, but the error is in the connect... maybe because of 
> >> timezone attribute of user
> >> anyone has any idea?
>
> >> 2010/8/7 Daniel França 
> >> Xavier, I think we are almost there :P
> >> because there's a timezone field in my account model:
>
> >> class Account(models.Model):
>
> >>     user = models.ForeignKey(User, unique=True, verbose_name=_('user'))
>
> >>     timezone = TimeZoneField(_('timezone'))
> >>     language = models.CharField(_('language'), max_length=10, 
> >> choices=settings.LANGUAGES, default=settings.LANGUAGE_CODE)
>
> >>     def __unicode__(self):
> >>         return self.user.username
>
> >> I tried to comment the line, but then the create_user abort with an 
> >> constraint timezone error.
>
> >> On Sat, Aug 7, 2010 at 2:22 PM, Xavier Ordoquy  
> >> wrote:
> >> And what's your Account model ?
> >> I noticed it is in its get_or_create that you get the error.
>
> >> Regards,
> >> Xavier.
>
> >> Le 7 août 2010 à 18:52, Daniel França a écrit :
>
> >>> Same error =/
> >>> but now,I don't know why.. it's saving at the db. The error still 
> >>> happens, but the data is in the database
>
> >>> On Sat, Aug 7, 2010 at 12:54 PM, Xavier Ordoquy  
> >>> wrote:
> >>> Sorry, I just woke up form a sleep :)
> >>> I notice you get-or-create a user.
> >>> However, did you try to call get or create with specifying the arguments 
> >>> ? first_name = "...", and so on ?
> >>> Does it still give an error ?
>
> >>> Regards,
> >>> Xavier.
>
> >>> Le 7 août 2010 à 17:46, Xavier Ordoquy a écrit :
>
>  I just googled your error and found:
> http://www.nerdydork.com/django-programmingerror-cant-adapt.html
>  According to the first comment, you might do something wrong with the 
>  arguments types.
>  Unless you give a table description (\d from psql shell) and the model 
>  I'm not sure I can help you further.
>
>  Regards,
>  Xavier.
>
>  As the stack seems to have a
>
>  Le 7 août 2010 à 17:21, Daniel França a écrit :
>
> > I just created my db using django manage syncdb, I think it should 
> > create right.
> > or how can I see the encode of each tables?
> > I'm using postgresql 8.4
> > maybe I'll need reinstall everything =S
>
> > On Sat, Aug 7, 2010 at 6:49 AM, Xavier Ordoquy  
> > wrote:
>
> > Le 7 août 2010 à 06:44, Daniel França a écrit :
>
> > > My database is UTF-8, it's fine, doesn't?.
> > > I'm afraid to reinstall everything from ports and start to get a lot 
> > > 64-32 bits incompatible issues like happened before =/
>
> > I think that should be fine with a utf-8 DB.
> > Are you sure your tables are UTF-8 ?
> > What database are you using ? mysql ? postgres ? I had no issue with 
> > both and I have a couple of non pure ascii sites.
> > However, when I moved to snow leopard, I recompiled mysql/postgres and 
> > the python drivers.
>
> > Regards,
> > Xavier.

Re: Announces django-guardian: per object permissions for Django 1.2

2010-08-04 Thread lukaszb
Thanks for the comment! I really do think that this "backends ready &&
included" parts of Django are extremely useful (and fun to extend if
needed).

About the admin, I haven't really get into admin integration yet as I
cannot answer this: should user with "flatpages.change_flatpage"
permission for flatpage instance be able to edit it at admin if he/she
doesn't have "flatpage.change_flatpage" global permission? I'm just
stuck here - I suppose it would be good to "turn off" ability to
change some objects for user with this global "app.change_obj"
permission removal. On the other hand, wouldn't it be too much to give
such global permission for user if we intend to allow him/her to
change only single object?

Am not sure if I should start such discussion here but I just couldn't
resist :)



On 4 Sie, 01:34, Russell Keith-Magee  wrote:
> On Wed, Aug 4, 2010 at 7:20 AM, lukaszb  wrote:
> > Hi all,
>
> > I'd like to announce django-guardian - very basic yet usable per
> > object permissions
> > implementation for Django 1.2, using new authorization backend
> > facilities.
>
> > It was created during 2 days sprint, code have been released and may
> > be found athttp://github.com/lukaszb/django-guardian/.
> > Documentation is available athttp://packages.python.org/django-guardian/.
>
> > Currently I think there should be better integration with admin app
> > and some shortcuts (permission assignment/removal)
> > should support table-level permissions as well.
>
> > If you spot a bug or have an idea how to improve this little app,
> > please spare a minute at issue tracker, which is located at
> >http://github.com/lukaszb/django-guardian/issues.
>
> > Hope someone would find this useful.
>
> > Take care,
> > Lukasz
>
> Hi Lukasz,
>
> Great stuff! Thanks for taking the effort to implement this and put it
> out in the open. It's a fantastic example of the sort of thing that
> can be very useful without needing to be part of core, which is the
> reason that we put the object-based permissions API into the auth
> backends.
>
> Regarding admin app integration -- integration of object-level
> permissions with the admin app is one area where I am aware there are
> some bugs (or, at least, some areas where the object-based permissions
> API isn't being used as it should). This aspect of Django's admin
> could do with some attention, so if your experience of implementing an
> object-based permissions backend has you contemplating a bigger
> project, auditing the admin for adherence to object-based permissions
> could be an interesting candidate.
>
> Yours,
> Russ Magee %-)

-- 
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: Announces django-guardian: per object permissions for Django 1.2

2010-08-04 Thread lukaszb
Welll, at the django.contrib.auth there are only those (User and
Group) models for which one may define permission sets and I wanted
guardian to be as simply as possible - so it is not possible to assign
permission to other model even if it "groups  users". At one point I
thought it could be nice to implement some kind of "roles" but I've
finally decided it would be better to stick to facilites provided by
new Django version.

On the other hand, I'm not sure if it is needed to create new
"grouping models" - I often use intermediate models for this (i.e.
Team model with fk to Group among other fields). Let me know if you
have different experience.

On 4 Sie, 15:26, derek  wrote:
> On Aug 4, 1:20 am, lukaszb  wrote:
>
>
>
>
>
> > Hi all,
>
> > I'd like to announce django-guardian - very basic yet usable per
> > object permissions
> > implementation for Django 1.2, using new authorization backend
> > facilities.
>
> > It was created during 2 days sprint, code have been released and may
> > be found athttp://github.com/lukaszb/django-guardian/.
> > Documentation is available athttp://packages.python.org/django-guardian/.
>
> > Currently I think there should be better integration with admin app
> > and some shortcuts (permission assignment/removal)
> > should support table-level permissions as well.
>
> > If you spot a bug or have an idea how to improve this little app,
> > please spare a minute at issue tracker, which is located 
> > athttp://github.com/lukaszb/django-guardian/issues.
>
> > Hope someone would find this useful.
>
> No doubt this will be extremely useful!  For me, integration with the
> Django admin is a must, though, as permissions will need to be
> assigned by users themselves via the standard interface.
>
> One (maybe stupid) question:  Can rights only be assigned to the pre-
> specified "Group", or can any model that handles user grouping (I have
> some custom ones in my app) be used?
>
> Thanks
> Derek

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



Announces django-guardian: per object permissions for Django 1.2

2010-08-03 Thread lukaszb
Hi all,

I'd like to announce django-guardian - very basic yet usable per
object permissions
implementation for Django 1.2, using new authorization backend
facilities.

It was created during 2 days sprint, code have been released and may
be found at http://github.com/lukaszb/django-guardian/.
Documentation is available at http://packages.python.org/django-guardian/.

Currently I think there should be better integration with admin app
and some shortcuts (permission assignment/removal)
should support table-level permissions as well.

If you spot a bug or have an idea how to improve this little app,
please spare a minute at issue tracker, which is located at
http://github.com/lukaszb/django-guardian/issues.

Hope someone would find this useful.

Take care,
Lukasz

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



How to count queries at unit tests

2010-06-02 Thread lukaszb
After firing up tests django sets DEBUG to False and
django.db.connection doesn't update it's queries attribute. Is there
any (probably lower level) access to fired queries? Or should I change/
write own runner class...

Anyone?

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