Re: lazy queryset

2011-10-25 Thread druce
Thanks Karen, I set DATABASES = { 'default': { 'OPTIONS': {'init_command': 'SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED'}, } } At first glance it seemed to do the trick. In fact it seemed to force the re-query every time I did .filter, without putting the QuerySet into

Re: lazy queryset

2011-10-25 Thread Karen Tracey
On Tue, Oct 25, 2011 at 7:39 PM, druce wrote: > Tried every other way I could think of. Any idea what I have to do to > force it to requery the database? > Sounds like you are a victim of the default REPEATABLE READ MySQL/InnoDB transaction isolation level. See this ticket for more details: htt

lazy queryset

2011-10-25 Thread druce
Having trouble getting a queryset to re-query the database and get updated results. Tried evaluating queryset in list and boolean context, no joy, always get the same results even though the database has changed. A bit of a newbie - am I missing something simple? [user@box dspider]# python manage

Re: Parsing a reStructuredText

2011-10-25 Thread eaman
On Oct 25, 7:04 pm, eaman wrote: > On Oct 25, 6:46 pm, "J. Cliff Dyer" wrote: > [CUT]> What have you got so far? I found this tutorial[1] that quite nails it, now I can traverse through document and extract a piece of content. I guess I'll have to learn to use a transformer -> writer to parse

Re: block behavior does not work as documented with respect to autoescape

2011-10-25 Thread Karen Tracey
On Tue, Oct 25, 2011 at 11:10 AM, psbanka wrote: > Am I reading the documentation wrong, or is there a Django error here? > There's a bit of an oddity in Django here, that actually has nothing to do with autoescape. There are three "built-in" tags (block, extends, and include) that are only made

Re: VirtualHost/Cache

2011-10-25 Thread Didex
Hi Tom Evans, Was exactly the ServerName. Thank you. :) On 24 Out, 15:14, Tom Evans wrote: > On Fri, Oct 21, 2011 at 10:57 AM, Didex wrote: > > Hello everyone, > > > I am trying setup a webserver(Centos) with two django sites, but i am > > havecacheproblems. > > > http.config: > > > NameVirtua

nested forms?!?

2011-10-25 Thread trubliphone
I am just banging my head against the wall and making no progress with this issue. I am trying to create a view that nests forms of related models. I had thought that inlineformset_factory would do the trick, but I clearly don't understand something. Assume I have the following models: cl

Re: User data being exposed with mod_wsgi/apache

2011-10-25 Thread Daniel Roseman
On Monday, 24 October 2011 23:14:40 UTC+1, Jennifer Bell wrote: > > On my site, some user data is automatically filled in to a form if a > user is logged in by accessing request.user in the view code. > > On deployment, it seems that if *any* user is logged in, forms > requested via another brow

Re: apache and remote_user

2011-10-25 Thread David Fischer
Have you taken a look at the RemoteUserMiddleware? https://docs.djangoproject.com/en/1.3/howto/auth-remote-user/ On Oct 25, 11:16 am, Tim wrote: > Hi, > I've read the django, wsgi, and apache docs and still making no progress. > Freebsd 8, Apache2.2.17, Django1.30, Python 2.7.1 > > I'm inside an

Re: Inline element not working as expected.

2011-10-25 Thread jenia ivlev
This is how you do it: class ItemInline(admin.TabularInline): model = Category.items.through class CategoryAdmin(admin.ModelAdmin): inlines = [ ItemInline, ] exclude = ('items',) On Oct 24, 9:48 pm, jenia ivlev wrote: > In the admin I want to use inline elements. I want

Revamping and existing project

2011-10-25 Thread jhames
hello, i am an absolute beginner with web dev, so bear with me here. i need to make several changes to my campany's django apps. nothing too complicated. in their settings.py file, i notice that they connect to a mysql database. i want to be able to view the page as i edit it but i don't understan

Re: Formwizard - Validation with a database lookup

2011-10-25 Thread youpsla
Hello, I've done it !!! yooohooo. But I think this is not the best way because it can be processor time consuming if I've a lots of suscribers (Wich is not the case now). Here is the code in forms.py: class Step1Form(forms.Form): email_adresse = forms.EmailField(max_length=255) telephone

Re: Basic Django admin question

2011-10-25 Thread Aaron Spesard
Nevermind. On Tue, Oct 25, 2011 at 3:22 PM, Aaron Spesard wrote: > I've been doing a couple of django tutorials over and over again just learn > by rote, so to speak. They are the 'Writing your first Django App' and > 'djangoles-tutorial.pdf. Today I decided to just try and build a similar > pro

Basic Django admin question

2011-10-25 Thread Aaron Spesard
I've been doing a couple of django tutorials over and over again just learn by rote, so to speak. They are the 'Writing your first Django App' and 'djangoles-tutorial.pdf. Today I decided to just try and build a similar project from scratch and I've run into a couple of problems. When I tried to ad

Formwizard - Validation with a database lookup

2011-10-25 Thread youpsla
Hello, I've setup a 5 steps form (There is only one table in the database). In the first step I ask for Email adresse. I ike this to be unique in the database. By putting parameters "unique=True" in models, the error only raise when submitting the form at the last step. Is there a way to do the

Re: Integrating Social Auth

2011-10-25 Thread Matías Aguirre
Excerpts from Sachin Gupta's message of 2011-10-24 05:09:15 -0200: > I have been trying to integrate > social-authand it has been a > failure till now. I have done all the steps mentioned on > this page, added the backends and the keys but it is not w

apache and remote_user

2011-10-25 Thread Tim
Hi, I've read the django, wsgi, and apache docs and still making no progress. Freebsd 8, Apache2.2.17, Django1.30, Python 2.7.1 I'm inside an intranet hosting my webapp locally within that intranet. I'd like to get the REMOTE_USER so people don't have to login again. My problem starts at Apach

Re: Parsing a reStructuredText

2011-10-25 Thread eaman
On Oct 25, 6:46 pm, "J. Cliff Dyer" wrote: [CUT] > What have you got so far? About 10 documents, longest one is around ~2700 'lines'. ...and I'm reading docutils documentation [1] and a blog entry quite near my topic [2] >  If you check out the docutils documentation, > you might find docutils.

Re: Parsing a reStructuredText

2011-10-25 Thread J. Cliff Dyer
On 10/25/2011 11:34 AM, eaman wrote: I'm developing a web site in django to manage guides / howtos that I've been writing in reStructuredText. I'd like to display each section of them in a single page, how can I parse the reStructuredText to get titles / context of single sections? What have you

Re: How to set up Apache to serve up django websites?

2011-10-25 Thread Roger Marcus
Hi Reikje, FANTASTIC TIP. The configuration in the book is straightforward and clear. It was not the 100% solution, but it took Apache out of the equation, and the focus was getting mod_wsgi configured and working. Debugging tip: the suggested script.wsgi is a great place to debug path issues. In

Cross-join

2011-10-25 Thread Daniel Gagnon
I'm having trouble with a particular query under the Django ORM. I have two models: Ticket and Target which have a many-to-many relationship. I want to list the cross-product of the two. For instance let say that Tickets Ref001 and Ref002 are both linked to Targets Tgt001, Tgt002 and Tgt003, I wa

Parsing a reStructuredText

2011-10-25 Thread eaman
I'm developing a web site in django to manage guides / howtos that I've been writing in reStructuredText. I'd like to display each section of them in a single page, how can I parse the reStructuredText to get titles / context of single sections? -- You received this message because you are subscr

block behavior does not work as documented with respect to autoescape

2011-10-25 Thread psbanka
In the current Django 1.3 documentation on templates (https://docs.djangoproject.com/en/1.3/topics/templates/#for-template- blocks), the documentation mentions the following: "The auto-escaping tag passes its effect onto templates that extend the current one as well as templates included via the i

Re: sprintf in python (not strictly django, but used all the time in django webapps)

2011-10-25 Thread Derek
Those can be a bit dry... for some variety, you could also try Doug Hellman's excellent "Module of the Week": http://www.doughellmann.com/PyMOTW/ On Oct 24, 4:11 pm, "Cal Leeming [Simplicity Media Ltd]" wrote: > You're correct :L > > Thanks for this - I think I might replace my daily break with r

Re: Field.Choices in Template

2011-10-25 Thread Andre Terra
I remember trying to help you with this on IRC, Kurtis. I've had the same problem before, but I could never remember that BoundFields have a field attribute.. If there isn't a note in the docs (or even better, an example), I'll make sure to write a patch in the next few days. Cheers, AT On 10/25

Re: How to handle apps independently in a Wsgi/Apache deployment

2011-10-25 Thread Andre Terra
Assuming I understood your question, here's a wild guess. Use different settings files and set the DJANGO_SETTINGS_MODULE on the fly on your .wsgi script Cheers, AT On 10/25/11, vpetkov wrote: > Hi, > > I have the standard Wsgi/Apache deployment with several apps in a > single project, admin

How to handle apps independently in a Wsgi/Apache deployment

2011-10-25 Thread vpetkov
Hi, I have the standard Wsgi/Apache deployment with several apps in a single project, admin enabled. I would like to keep the apps independent in production, so that a possible error in one does not bring down the whole wsgi daemon process and leave the other apps inaccessible. What I found i

Re: How to set up Apache to serve up django websites?

2011-10-25 Thread Reikje
On a side note, I can recommend this book: http://www.packtpub.com/django-1-1-testing-and-debugging/book They have an entire chapter for running Django on Apache. /Reik On Oct 24, 8:39 am, Roger Marcus wrote: > I have the django project Mezzanine up and working well. They have done a > much bett

Fixtures and FileField

2011-10-25 Thread Tomek Paczkowski
Hello, I'm looking for some way of bundling files from FileFields into fixtures. There is clear void of information on this subject. -- 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

Re: How to make a foreign key field of type other than int?

2011-10-25 Thread Kayode Odeyemi
On Mon, Oct 24, 2011 at 6:30 PM, Carl Meyer wrote: > Hi, > > On Oct 24, 10:53 am, Kayode Odeyemi wrote: > > I'm sorry but it doesn't just seem to work for me. I have tried > > > > possibilities like: > > > > self.fields['branch_name'].choices = > > Branch.objects.all().values('name_branch', 'nam