Re: Using variables as keywords in QuerySet

2009-10-21 Thread Arthur Metasov
2009/10/21 valler <180...@gmail.com>: > > Hello. I want to know, if something like that possible: >  MyModel.objects.filter(name__contains='foo',status__exact='bar') => > It's OK. > > But I want to use dynamic keyword generation, like that: >  a='name' >  b='status' >  MyModel.objects.filter(a__co

Re: Apply decorator to view functions in third-party apps?

2009-10-13 Thread Arthur Metasov
2009/10/13, Nan : > > Making request global definitely sounds like a potentially fragile > solution. I noticed that the template loaders take a directory list > argument, but it doesn't seem to ever get passed in -- it's not even > an argument for loader.get_template() or loader.select_template()

Re: authorization

2009-10-13 Thread Arthur Metasov
2009/10/13 elminio > > Hi, > > By admin I can choose what users can do with model objects. And what > about certain pages. Do I have to write if in everyone view method (to > check is current user may access given view ? > > Or is there any built in tool that makes it possible to restrict > acces

Re: Uploading an Image.

2009-10-13 Thread Arthur Metasov
2009/10/13 Chirolo > > Hi Arthur. > I'm not so experience with linux. > I can get to the directories and files of apparmor, but how do I > stopped. > Thank you. > Something like this > u...@host$ sudo /etc/init.d/apparmor stop > * Unloading AppArmor profiles

Re: Apply decorator to view functions in third-party apps?

2009-10-13 Thread Arthur Metasov
).theme > theme_template = theme.adjust_theme_path(template) > t = loader.select_template((template, theme_template)) > return HttpResponse(t.render(RequestContext(request, context))) > > A custom template loader would be a really neat solution, but I can't > see any way to pass it

Re: how to get back to a view requiring login

2009-10-12 Thread Arthur Metasov
as for me, @login_required decorator redirects to http://localhost/accounts/login/?next=/path/ if you use generic view to display login page it will automatically redirect user to /path/ after login. 2009/10/12 Sergio A. > > I've three views each with different URL. They are visible to logged >

Re: __unicode__(self) doesn't work

2009-10-12 Thread Arthur Metasov
2009/10/12 Denis Bahati > Hi there i have the problem with unicode function it doesn't give me any > changes. the poll list is displayed as Poll object and does doesn't give me > error if i write the models.py like this:from django.db import models > import datetime > > class Poll(models.Model):

Re: Apply decorator to view functions in third-party apps?

2009-10-12 Thread Arthur Metasov
You should carefully look at the code of django template loaders. What do you mean? Dou you want template paths to be stored in the database and dinamically change? Or do you want to use 3rd-party app but change template dirs it is looking for? 2009/10/12 ringemup > > I need to find a way to pro

Re: sorl thumbnail error

2009-10-11 Thread Arthur Metasov
2009/10/12 Malcolm MacKinnon > Hi, > I'm getting error messages with sorl thumbnail. I'm simply trying to show > thumbnail images on my template. I select a number of images in my views, > and iterate over my selection. Note that all my images are a certain size, > and I'm just trying to reduce t

Re: Uploading an Image.

2009-10-11 Thread Arthur Metasov
If you use distribution with apparmor try to stop it (/etc/init.d/apparmor). If the problem disappears, find apparmor config for apache and add there /home/Djangoprojects/ rw, /home/Djangoprojects/** rw, /home/Djangoprojects/imageupload/** rw, 2009/10/11 Chirolo > > Hi Bayuadji. > I already ch