Re: Word Cap Form Labels

2012-04-18 Thread Jonathan D. Baker
Not sure about django, but this is easy to do in CSS. Sent from my iPhone On Apr 18, 2012, at 11:21 PM, Lee Hinde wrote: > The default behavior for a form label is to capitalize the first letter - > 'Report name'. I'd like to capitalize the first letter of each word - 'Report > Name'. Short o

Word Cap Form Labels

2012-04-18 Thread Lee Hinde
The default behavior for a form label is to capitalize the first letter - 'Report name'. I'd like to capitalize the first letter of each word - 'Report Name'. Short of manually over-riding each label, is there a built-in way to do that? Thanks. -- You received this message because you are subscr

django treemenus implementation question

2012-04-18 Thread gowtham
Hi Everyone, Another newbie question to the group. For the tiny Django application I created for past few weeks, we decided to implement a menu with tree structure. I found django-treemenus application started to implement it (I am still open to other suggestions). I could not quite get everything

Re: cannot import name current_datetime

2012-04-18 Thread Babatunde Akinyanmi
I have a feeling you want to do: Import datetime not import current_datetime On 4/18/12, asherakhet06 wrote: > H all! > > I am fairly new to programming (went over LPTHW) and now going through the > Djangobook on the internet. Quick beginners question: In Chapter 3, where > I am looking at a dy

cannot import name current_datetime

2012-04-18 Thread asherakhet06
H all! I am fairly new to programming (went over LPTHW) and now going through the Djangobook on the internet. Quick beginners question: In Chapter 3, where I am looking at a dynamic webpage in the 2nd example I am running into some problems with the current_datetime function I am trying to se

Re: Returning template data from a ManyToMany model

2012-04-18 Thread LJ
Thank you, Daniel. That makes sense now. If the full objects are already there, then this should work great! L J On Apr 17, 4:07 am, Daniel Roseman wrote: > On Tuesday, 17 April 2012 07:10:35 UTC+1, LJ wrote: > > > I am having trouble figuring out how to query the database and return > > the resu

Re: Returning template data from a ManyToMany model

2012-04-18 Thread LJ
Thank you, Phang. I was not familiar with the locals() method, so I may look into this. L J On Apr 17, 2:22 am, Phang Mulianto wrote: > On Tue, Apr 17, 2012 at 2:10 PM, LJ wrote: > > I am having trouble figuring out how to query the database and return > > the results in a format that my templa

Re: apache2 privileges

2012-04-18 Thread Daniel Sokolowski
Hi Bruno, Can you expand on that, each of your sites has a user account created? Yes? -Original Message- From: bruno desthuilliers Sent: Wednesday, April 18, 2012 10:21 AM To: Django users Subject: Re: apache2 privileges On Mar 9, 6:43 pm, "j...@jsdey.com" wrote: My apache2 server o

Re: apache2 privileges

2012-04-18 Thread bruno desthuilliers
On Mar 9, 6:43 pm, "j...@jsdey.com" wrote: > My apache2 server on linux is running as www-data.  My project is in a > standard user account.  apache2 can't access files on the user account Using mod_wsgi in daemon mode let you run the django processes as another user/group, and this is definitly

Re: Is there such a open source django project?

2012-04-18 Thread Daniel Sokolowski
We used django-helpdesk however it does not include scheduling, perhaps the latest version does and it would make a great starting point – extend the wheel rather then re-invent it Link: https://github.com/rossp/django-helpdesk/ From: Mario Gudelj Sent: Tuesday, April 17, 2012 6:47 PM To: dj

Re: [Question] Filter Queryset in a Template

2012-04-18 Thread Daniel Sokolowski
A third alternative that I use very often is to create custom managers. For example all my models have a status field which dictates if the object is shown on main site or not, hence I create a custom manager method called ‘live’ and I can do: Gallery.objects.live() But what is nice is that

Re: Logging works from 'manage.py shell', not from app

2012-04-18 Thread Daniel Sokolowski
I find I had to make a catch all handler for logging to work: in settings.py ... 'loggers': { '': { # catch all logger 'handlers': ['console'], 'level': 'WARNING', # re-defined in settings_dev 'propagate': True }, ... And in files I need logging I do:

Re: apache2 privileges

2012-04-18 Thread Daniel Sokolowski
You may also want to look into putting a sticky bit on the directory which would result in any files created to have group ownership of the parent directory - this allows to have the owner of the files be anyone where the group owner 'www-data' remaining constant and apache being able to access

Re: Django deployment practices -- do people use setup.py?

2012-04-18 Thread Daniel Sokolowski
Hi Andrew, Can you clarify if you approach can handle things that are not installable through pip? For example I run into an issue with geodjango requirements - I was not able to get everything installed through PIP and had to resort to manually using the Debian package management. -Orig

Re: Django 1.4, Postgresql and partitioned table

2012-04-18 Thread akaariai
On Apr 18, 3:49 pm, Michaël Journo wrote: > Well you were right. The insert didn't return the id, so that was the > problem. > > I used your trick (customizing the save method) and it seems to work > just fine. Glad it helped. A mandatory warning: you are using non-public parts of Django's backe

Re: Django 1.4, Postgresql and partitioned table

2012-04-18 Thread Michaël Journo
Well you were right. The insert didn't return the id, so that was the problem. I used your trick (customizing the save method) and it seems to work just fine. So thank you ! On 17 avr, 20:58, akaariai wrote: > The problem seems to be that INSERT INTO partitioned_table values(...) > RETURNING ID

Re: How to release the caching of QuerySet

2012-04-18 Thread Kejun He
Hi, On Wed, Apr 18, 2012 at 8:03 PM, akaariai wrote: > On Apr 18, 2:48 pm, Kejun He wrote: > > (2) > > About the query if be executed > > > > if the code like below, and do no operation on variable tmp:>>>tmp = > Demo.objects.filter(pid=p_id) > > > > The query would not be executed actually

Re: How to release the caching of QuerySet

2012-04-18 Thread akaariai
On Apr 18, 2:48 pm, Kejun He wrote: > (2) > About the query if be executed > > if the code like below, and do no operation on variable tmp:>>>tmp = > Demo.objects.filter(pid=p_id) > > The query would not be executed actually untill do some operation on > tmp(exp:tmp.count()) > > if just do "Demo

Re: Django deployment practices -- do people use setup.py?

2012-04-18 Thread Andrew Cutler
On 15 March 2012 12:33, Andrew Cutler wrote: > > We also want to be able to distribute a self contained Django project > with sane defaults (and this is where it gets tricky). > Answering my own question here... But I've finally achieved the "holy grail" of Django project deployment using setup.p

Re: How to release the caching of QuerySet

2012-04-18 Thread Kejun He
Hi akaariai, Thanks for your reply. (1) I wrote the simple example just wanted to check the queryset if consume more and more memory. And did no operation on the result. In my project, I define a method; I execute a queryset and do some operation on the result in the method. (2) About the que

Re: apache2 privileges

2012-04-18 Thread Andreas Schosser
Hi John > My apache2 server on linux is running as www-data. My project is in a > standard user account. apache2 can't access files on the user account > unless I change the user on the user account directory to www-data. Try this: # chown -R john:www-data /your/project # find /your/project -ty

Re: Missing manage.py

2012-04-18 Thread Faeez Abd Rahman
I'm using Mac OS X version 10.7.3. I tried installed Django using SVN and download and running the setup.py command, both results in the missing manage.py file. I manage to find the location of the stub directory /project_template /project_name _init_.py _init_.pyc settings.py settings.pyc urls

Re: Missing manage.py

2012-04-18 Thread Tom Evans
On Wed, Apr 18, 2012 at 11:54 AM, Faeez Abd Rahman wrote: > Hi, > > I will try to remove and install django as you suggest, but before that I > like to look for that stub directory. Where is the location of that stub > directory? > > thanks. > I don't know the specifics of your OS or how you inst

Re: Missing manage.py

2012-04-18 Thread Faeez Abd Rahman
Hi, I will try to remove and install django as you suggest, but before that I like to look for that stub directory. Where is the location of that stub directory? thanks. On Wed, Apr 18, 2012 at 6:44 PM, Tom Evans wrote: > On Wed, Apr 18, 2012 at 11:35 AM, Faeez Abd Rahman > wrote: > > Hi Budd

Re: Missing manage.py

2012-04-18 Thread Tom Evans
On Wed, Apr 18, 2012 at 11:35 AM, Faeez Abd Rahman wrote: > Hi Buddy, > > Nope it's not there, I have tried to create another project, still not > there. > > mysite/ > mysite/ > __init__.py > settings.py > urls.py > wsgi.py > > > I followed the tutorial, so all

Re: Missing manage.py

2012-04-18 Thread Faeez Abd Rahman
Hi tonton, without the manage.py, I can't create any apps. On Wed, Apr 18, 2012 at 6:35 PM, Faeez Abd Rahman wrote: > Hi Buddy, > > Nope it's not there, I have tried to create another project, still not > there. > > mysite/ > mysite/ > __init__.py > settings.py > ur

Re: How to release the caching of QuerySet

2012-04-18 Thread akaariai
On Apr 18, 1:05 pm, Kejun He wrote: > and define a method named test in views.py. like below: > > def test(p_id): >     # Just execute the filter 1000 times >     for i in xrange(1000): >         Demo.objects.filter(pid=p_id) > > run the test function again:>>>test(1) > > The occupied memory i

Re: Missing manage.py

2012-04-18 Thread Faeez Abd Rahman
Hi Buddy, Nope it's not there, I have tried to create another project, still not there. mysite/ mysite/ __init__.py settings.py urls.py wsgi.py I followed the tutorial, so all files created as above, except for manage.py On Wed, Apr 18, 2012 at 6:31 PM, Fae

Re: Missing manage.py

2012-04-18 Thread Faeez Abd Rahman
Hi, Hi, I'm using Django 1.4, Python 2.7 and nope I did not use virtual env. On Tue, Apr 17, 2012 at 2:16 AM, andrea mucci wrote: > hi > > could you post > django version > python version > you use virtualenv? if yes what version > and the code you use to generate the project > > cheers > El

Re: How to release the caching of QuerySet

2012-04-18 Thread Kejun He
Hi, Thank you for your reply. I have set DEBUG=False in settings.py and try again. The the problem still exists. and the result of sys.getrefcount(Demo) is not 0 gc.garbage() is [] regards, Kejun On Wed, Apr 18, 2012 at 6:09 PM, Tom Evans wrote: > On Wed, Apr 18, 2012 at 11:05 AM, Kejun He w

Increased number of columns in admin/change_list page leads to cross page boundary

2012-04-18 Thread Nikhil Verma
HI All I have an app whose admin used to contain 10 columns but now as the requirement grows i have 18 columns which leads to disturbance in the GUI of the change_list page. The last 2-3 columns are getting to extreme right by which the look gets spoiled. Moreover i have to scroll the page in rig

Re: Admin site not working

2012-04-18 Thread Kejun He
Hi, Did you uncomment the code below on urls.py? # from django.contrib import admin # admin.autodiscover() And Did you add "django.contrib.admin" into INSTALLED_APPS on settings.py? On Tue, Apr 17, 2012 at 6:26 PM, mohamed elsebaey wrote: > Dear andrea > thanks for your reply > i'd ran the

Re: How to release the caching of QuerySet

2012-04-18 Thread Tom Evans
On Wed, Apr 18, 2012 at 11:05 AM, Kejun He wrote: > Hi, > >   I met a problem about memory overflow on a Django project. > I spent much of time finding the reason and I got some question about how > the > django release the caching of QuerySet. > > Exp: > I build a Model class like below: > > clas

How to release the caching of QuerySet

2012-04-18 Thread Kejun He
Hi, I met a problem about memory overflow on a Django project. I spent much of time finding the reason and I got some question about how the django release the caching of QuerySet. Exp: I build a Model class like below: class Demo(models.Model): pid = models.IntegerField() and define a me

Re: Can't access database with normal Ubuntu Terminal user

2012-04-18 Thread Gelonida N
Not sure if this helps you. I had to create the file ~/.pgpass in the home directory of my developers account. I repeated there the data base name, the user name and the password for my database. Example: localhost:*:db_name:username:password Afterwards I was able to access the db with ./ma

Re: ModelForm Validation Error

2012-04-18 Thread Tom Evans
On Tue, Apr 17, 2012 at 8:07 PM, coded kid wrote: > I want to make sure users fill all the fields before they are > redirected to the next page. And if they don’t fill the fields it > should raise an error telling them to fill the fields before they > proceed. So to do that, I wrote the codes belo

Re: Logging works from 'manage.py shell', not from app

2012-04-18 Thread Gelonida N
On 04/13/2012 07:41 PM, Jeff Blaine wrote: > Hi all. I'm stumped on something. Using logging via 'manage.py shell' is > working as expected. Using it in the webapp generates zero data and > zero errors. I'm not sure whether this is your problem, but please note, that logging to a log file is not a

How to do form validation for inline formsets?

2012-04-18 Thread Derek
Working with Django 1.3 I can create and run an inline formset without problems using Approach 1. However, when I try Approach 2, then I get the error below, triggered by the line shown. TypeError at /uploads/details/1 __init__() got an unexpected keyword argument 'instance' Clearly, my syntax