Custom select_related()

2011-06-07 Thread mhulse
Hello, I have a M2M field... class A(models.Model): foo1 = models.ManyToManyField('B', related_name='foo1_set' ...) foo2 = models.ManyToManyField('B', related_name='foo2_set' ...) ... When I run: ...foo.select_related() I get all of the B entries related to A instance. I would lik

Re: Django Development Environments

2011-06-07 Thread Xavier Ordoquy
Hi, > Xavier, could you point to any resources about using buildout with Django, > virtualenv and pip? I'm assuming you're using it to deploy things into > production, right? I usually use virtualenv / pip for early development as it requires almost no setup. I prefer using buildout once the

Re: Custom select_related()

2011-06-07 Thread Martin
Why not create a Manager? Give it a method foo1_related() which then returns something like self.foo1_set.filter( your filters ) and a similar method foo2_related (if needed). You can then call A.foo1_related() and get what you need. Best regards, Martin On Tue, Jun 7, 2011 at 4:08 PM, mhulse

overriding admin/bashe.html block messages.

2011-06-07 Thread Marc Aymerich
HI I'm trying to override the block messages in order to allow messages with HTML in one of my model changelist pages. After realizing that the tipical override with template extension seems that doesn't work with messages block I go to the original django base.html admin template to try the modif

repr(request.session)

2011-06-07 Thread Henrik Genssen
Hi, I try to add the content of my session to the error-mails. I have written a middleware, overwriting the standard error mail. But for: repr(request.session) I only get: What am I doing wrong? regards Henrik -- You received this message because you are subscribed to the Google Groups "Dja

Re: Django Development Environments

2011-06-07 Thread Mário Neto
Dev. Mac OS X PyCharm Virtualenv pip Mercurial (Bitbucket) debug-toolbar and extensions Prod. 1 RedHat Apache mod_wsgi Prod. 2 Debian Cherokee uwsgi 2011/6/7 Xavier Ordoquy > Hi, > > > Xavier, could you point to any resources about using buildout with > Django, virtualenv and pip? I'm assumin

Re: Django Development Environments

2011-06-07 Thread Bjarni Rúnar Einarsson
Dev: - Ubuntu 11.04 (netbook) - vim - git - in-memory mocks of user DB - bundled Django dev server + PageKite for testing & showing coworkers Production: - debian stable (linode) - redis for replicated user DB / sqlite for rarely-changing site content - lighttpd + fastcgi/flup (hot pages c

Re: files managing

2011-06-07 Thread Mateusz Marzantowicz
On Tue, Jun 7, 2011 at 5:15 AM, pankaj sharma wrote: > hello everyone, i need some help; > i want the users to download some files.. {say photos} > and what setting do i have to take care using FileField. where all > these photos will be stored and how can user download the photos > > -- > You rec

New to Django, need some help with tutorial

2011-06-07 Thread Dori Rutkevitz
Hi all, I am new to programming in general and recently decided to pick up Django. Im reading bits of a book on Python, and im starting to stumble through the Djangoproject.com tutorial. My problem might be embarrassingly simple, but i could really use some help. I created my first project us

Re: code 128 or code 39 barcode generation

2011-06-07 Thread Thomas Turner
see https://code.djangoproject.com/wiki/Barcodes On Apr 18, 7:12 pm, Steven L Smith wrote: > There's a great wrapper you can use to generate these in PIL using a > postscript library.http://pypi.python.org/pypi/elaphe/ > > I did something similar with pyqrnative to generate QR Codes for a > confe

Re: New to Django, need some help with tutorial

2011-06-07 Thread Xavier Ordoquy
Le 7 juin 2011 à 07:59, Dori Rutkevitz a écrit : > Hi all, > > I am new to programming in general and recently decided to pick up Django. Im > reading bits of a book on Python, and im starting to stumble through the > Djangoproject.com tutorial. My problem might be embarrassingly simple, but i

Re: repr(request.session)

2011-06-07 Thread Malcolm Box
n 7 June 2011 10:46, Henrik Genssen wrote: > I try to add the content of my session to the error-mails. > I have written a middleware, overwriting the standard error mail. > But for: > repr(request.session) > I only get: > > > What am I doing wrong? > > That is the how a session object displays.

Add custom html between two model fields in Django admin's change_form

2011-06-07 Thread mf
Let's say I've two models: class Book(models.Model): name = models.CharField(max_length=50) library = models.ForeignKeyField('Library') class Library(models.Model): name = models.CharField(max_length=50) address = models.CharField(max_length=50) tel

Users not logging out

2011-06-07 Thread jayhalleaux
I have the django auth system set correctly, my only problem is that is if the user does not use the logout and just closes the browser, they are still logged in. Any suggestions? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Users not logging out

2011-06-07 Thread Tim Sawyer
Try putting: SESSION_EXPIRE_AT_BROWSER_CLOSE = True in your settings.py file. Tim. > I have the django auth system set correctly, my only problem is that > is if the user does not use the logout and just closes the browser, > they are still logged in. > > Any suggestions? > > -- > You received

Re: Users not logging out

2011-06-07 Thread Shawn Milochik
On 06/07/2011 09:20 AM, jayhalleaux wrote: I have the django auth system set correctly, my only problem is that is if the user does not use the logout and just closes the browser, they are still logged in. Any suggestions? Any suggestions for how to accomplish what? -- You received this messa

Re: Users not logging out

2011-06-07 Thread jayhalleaux
works perfectly... thanks :) On Jun 7, 9:29 am, "Tim Sawyer" wrote: > Try putting: > > SESSION_EXPIRE_AT_BROWSER_CLOSE = True > > in your settings.py file. > > Tim. > > > > > I have the django auth system set correctly, my only problem is that > > is if the user does not use the logout and just c

Re: Users not logging out

2011-06-07 Thread jayhalleaux
i take that back. If I log in and then I close the tab, I can go back and still use the url to go to a login required page. -- 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 u

Re: Users not logging out

2011-06-07 Thread christian.posta
so, is that what you wanted? sounds like when the user is done with the session, and they navigate away (by closing the browser or closing the tab which browser are you using btw, chrome?), then the session closes as is indicated by the SESSION_EXPIRE_AT_BROWSER_CLOSE setting. Isn't that what y

Re: New to Django, need some help with tutorial

2011-06-07 Thread oneroler
Below is the information on adding python to your windows path from the python website http://docs.python.org/faq/windows.html for windows 7 you just go into 'edit environment variables for your account' under system in control panel and add your python path (e.g. c:\python27) to the 'Path' field

Re: Accessing template name inside a template?

2011-06-07 Thread Derek
On Jun 6, 8:08 pm, Roy Smith wrote: > For diagnostic purposes, I want every one of my templates to emit an > HTML comment showing the template name.  I was doing fine just > dropping "", etc, in each template, until the first > time I renamed a template and forgot to update the comment :-) > > Any

Re: Add custom html between two model fields in Django admin's change_form

2011-06-07 Thread christian.posta
Create a different ModelForm that contains your readonly fields (and populate them however you want) and set this on your ModelAdmin form. See the ModelAdmin.form option in the docs. https://docs.djangoproject.com/en/1.2/ref/contrib/admin/#modeladmin-options On Jun 7, 6:01 am, mf wrote: > Let

Re: Users not logging out

2011-06-07 Thread Derek
On Jun 7, 3:39 pm, jayhalleaux wrote: > i take that back. > > If I log in and then I close the tab, I can go back and still use the > url to go to a login required page. close_tab != CLOSE_BROWSER (An interesting discussion on this type of problem: http://www.thewebsqueeze.com/forum/PHP-f11/Logo

django transactions.

2011-06-07 Thread Marc Aymerich
Hi, I've activated the 'django.middleware.transaction.TransactionMiddleware' and I've decorated one method with @transaction.commit_on_success With this I expect that if the method raise an exception, django rolls back any database operation executed by this method, even the operations executed by

Re: Parsing feeds that are imported

2011-06-07 Thread Chris Lawlor
I've not used the django community aggregator, so I'm making some assumptions about it's functionality. If that app were to emit a signal for each feed entry that it processed, it would be fairly simple to write a signal handler that would create the associations that you want. With this approach

Re: Making a login/create user interface

2011-06-07 Thread imageguy
I would recommend django-registration as well. Seems to handle all the machinery quite well. -- 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/-/VnRGWTd6ZDhLR

Re: Add custom html between two model fields in Django admin's change_form

2011-06-07 Thread mf
Thanks christian. I've followed your good advice but I don't know why am I getting this error: "PresupuestoAdmin.readonly_fields[1], 'name' is not a callable or an attribute of 'PresupuestoAdmin' or found in the model 'Presupuesto' ". It seems that the 'name' field is not added to the form used by

Re: Custom select_related()

2011-06-07 Thread Micky Hulse
Hi Martin! Thanks so much for the quick reply, I really appreciate your help. :) On Tue, Jun 7, 2011 at 1:48 AM, Martin wrote: > Why not create a Manager? > Give it a method foo1_related() which then returns something like > self.foo1_set.filter( your filters ) and a similar method foo2_related (

Re: New to Django, need some help with tutorial

2011-06-07 Thread Dori Rutkevitz
Alexy, Xavier and Sam thank you all very much - I am on windows and i just needed to add the python directory to my system path. thanks so much for the help, on with the tutorial : ) -Dori -- You received this message because you are subscribed to the Google Groups "Django users" group. To vi

Re: ManyToManyField limit_choices_to that instance via Django admin.

2011-06-07 Thread Ryan
This is possible, but I'm not sure if you could do it via limit_choices_to. The admin docs shows how to accomplish this here: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.formfield_for_manytomany Ryan -- You received this message because you are sub

Re: ManyToManyField limit_choices_to that instance via Django admin.

2011-06-07 Thread Micky Hulse
Hi Ryan! Thanks so much for the reply, I really appreciate the help. :) On Tue, Jun 7, 2011 at 12:17 PM, Ryan wrote: > This is possible, but I'm not sure if you could do it via limit_choices_to. > The admin docs shows how to accomplish this here: Oooh, interesting. I will experiment with that so

Re: Excel dumps to Office 10

2011-06-07 Thread Marwan Al-Sabbagh
So what you are doing is producing HTML content, but send the user a file with an xls extension. Before MS Excel used to open the xls file see that in fact it doesn't have xls data in it but HTML and would try and take care of it by converting the html to excel and presenting to the user. In more r

Re: Users not logging out

2011-06-07 Thread Malcolm Box
On 7 June 2011 15:14, Derek wrote: > On Jun 7, 3:39 pm, jayhalleaux wrote: > > i take that back. > > > > If I log in and then I close the tab, I can go back and still use the > > url to go to a login required page. > > close_tab != CLOSE_BROWSER > > (An interesting discussion on this type of pro

Re: django transactions.

2011-06-07 Thread Malcolm Box
n 7 June 2011 15:16, Marc Aymerich wrote: > Hi, > I've activated the > 'django.middleware.transaction.TransactionMiddleware' and I've > decorated one method with @transaction.commit_on_success > With this I expect that if the method raise an exception, django rolls > back any database operation e

Re: Re: Odp: Re: signals pre_save vs model's save()

2011-06-07 Thread Malcolm Box
On 2 June 2011 23:37, Mateusz Harasymczuk wrote: > That was a very good and convincing post :} > I am testing a solution with .clean(), which IMHO is a better place to > clean data before save() > > Glad to have been of help. clean() is ideal for cleaning up stuff from forms, so could be a great

Re: Making a login/create user interface

2011-06-07 Thread raj
I got completely lost when looking at that. I don't even know how to describe my confusion. I guess my issue is that I'm not seeing the big picture when reading to the tutorial. And i'm, not familiar with the django-registration thing described below. Is it possible that you can create a very simpl

Re: django transactions.

2011-06-07 Thread Christophe Pettus
On Jun 7, 2011, at 7:16 AM, Marc Aymerich wrote: > With this I expect that if the method raise an exception, django rolls > back any database operation executed by this method, even the > operations executed by submethods called by this main method, right? That's correct. > So I got this except

Re: Making a login/create user interface

2011-06-07 Thread Martin
Are you kidding? https://docs.djangoproject.com/en/1.3/topics/auth/#authentication-in-web-requests The docs are crystal clear. And if you don't want to implement your own views, django-registration is as simple as

ANN: django-supervisor: easy integration between django and supervisord

2011-06-07 Thread Ryan Kelly
Hi All, I've just released a little experiment in combining the process management awesomeness of supervisord with the convenience of Django's management scripts. It's called, funnily enough, django-supervisor: http://pypi.python.org/pypi/django-supervisor/ The concept is simp

VERY cheap django hosting?

2011-06-07 Thread raj
Hey guys, Just wondering if you could give me some hosts that are very cheap for django hosting? Is hostgator any good? I really don't know what to look for in a host. A lot of people are recommending web faction, but its around $9 bucks a month. I was looking in the $5 bucks a month range. Any ide

Re: VERY cheap django hosting?

2011-06-07 Thread Maksymus007
megiteam.pl is 24PLN which is about 8usd a month:) Pozdrawiam, Maksymilian Pawlak 08-06-2011 08:30 użytkownik "raj" napisał: > Hey guys, > Just wondering if you could give me some hosts that are very cheap for > django hosting? Is hostgator any good? I really don't know what to > look for in a ho