Re: Admin - click through to parent / child

2011-02-17 Thread Derek
On Feb 16, 7:22 pm, Alec wrote: > Hi, > > I'm wondering if there are any add-ons that show a list of children > and give the ability to click through to parent or children records. > I'm aware of the InlineAdmin feature, but I'm thinking of a non- > editable list of children

Database setting from a configuration file.

2011-02-17 Thread hollando
Hi, I tried to put database setting in a ConfigParser format file and parse that file from command line. I modified manage.py a little bit after loading setting, reinitial DATABASES['default'] with my configure parameter. However, when it comes to execute_manager, it gets data from settings.py

query set on a manytomany table

2011-02-17 Thread Bobby Roberts
I have a Manytomanyfield in a model called "registrants" on a fieldname called locations. It stores the person's facility values in a table in the database in something called like registrants_locations_values (just as an example). How can i do a query on the registrants_locations_values table

Re: ManyToMany problem

2011-02-17 Thread Karen Tracey
On Thu, Feb 17, 2011 at 5:01 AM, Amar wrote: > OK, I've created a barebone app which shows this problem, so if anyone > can try this and duplicate, I'll report this as a bug (unless there is > a problem wih my code) > You can get it here

Re: How to reinstall Python Interpreters?

2011-02-17 Thread Mike Ramirez
On Thursday, February 17, 2011 04:48:31 pm LJ wrote: > I installed the latest version of dajaxice, but I am still getting > Unresolved import errors. > My guess is that I need to remove and reinstall the Python > Interpreters. > Is there a some documentation somewhere that explains how to

Re: How to reinstall Python Interpreters?

2011-02-17 Thread Shawn Milochik
On 02/17/2011 07:48 PM, LJ wrote: I installed the latest version of dajaxice, but I am still getting Unresolved import errors. My guess is that I need to remove and reinstall the Python Interpreters. Is there a some documentation somewhere that explains how to reinstall the Python Interpreters,

How to reinstall Python Interpreters?

2011-02-17 Thread LJ
I installed the latest version of dajaxice, but I am still getting Unresolved import errors. My guess is that I need to remove and reinstall the Python Interpreters. Is there a some documentation somewhere that explains how to reinstall the Python Interpreters, so I can resolve all of my

Re: Initial data in forms

2011-02-17 Thread YomGuy
Sorry I'm tired. Got it ! collection = MediaCollection.objects.get(public_id=public_id) form = MediaCollectionForm(instance=collection) 2011/2/18 YomGuy > Hi ! > > I need to get initial data in a form. > Do I have to use a formset or is there any method to fill a form

Initial data in forms

2011-02-17 Thread YomGuy
Hi ! I need to get initial data in a form. Do I have to use a formset or is there any method to fill a form coming from a model item with existing data ? Thank for help G -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

select_related with latest svn (15560)

2011-02-17 Thread Sneaky Wombat
Is anyone having a problem displaying foreign key fields in the admin? If I include a foreign key in the list_display of the admin model that controls my db model, it won't display any rows. I did some debug sleuthing and discovered if I commented out two lines (seen below), everything displays

Debugging automatic related database fetches

2011-02-17 Thread Mark
I have a large application where I make significant use of select_related() to bring in related model data during each original query. As the application has grown, the select_related calls haven't completely kept up, leaving a number of scenarios where Django happily and kindly goes running off

Re: How to Auto fill fields on Save in Django Admin?

2011-02-17 Thread Matteius
OK well I've refactored my complete approach to be in line with Django best practices and moved validation to validate_unique definitions. I started to rethink the Announcement too by implementing: def clean_fields(self, exclude=['author',]): """ Implement wrapper for clean_fields to

Re: Displaying a table and make its columns sortable

2011-02-17 Thread Shawn Milochik
On Thu, Feb 17, 2011 at 4:44 PM, Arun K.Rajeevan wrote: > Show me the django way to do this. > The "Django" way to do this is to learn basic programming skills. You originally asked a mess of random questions which didn't have anything to do with Django. We answered

LOGIN_REDIRECT_URL from urls.py?

2011-02-17 Thread galago
Is it possible to make value of LOGIN_REDIRECT_URL from my urls.py? I don't wan't to hardcode it. I don't want to pass next in my url. Maybe there is another way to redirect to my reverse('index')? -- You received this message because you are subscribed to the Google Groups "Django users"

Re: how to get attribute of intermediary model?

2011-02-17 Thread Daniel Roseman
On Thursday, February 17, 2011 10:06:40 PM UTC, Margie Roginski wrote: > > Thanks for your reply, Daniel. I didn't give my example specifically > enough. In my particular case I actually have a handle to the Person > and actually don't need all the join dates for all the people in that >

Re: how to get attribute of intermediary model?

2011-02-17 Thread Margie Roginski
Thanks for your reply, Daniel. I didn't give my example specifically enough. In my particular case I actually have a handle to the Person and actually don't need all the join dates for all the people in that group. I just need that person's join date. I can see that it is easy to get all

Re: Unit Testing: temporarily altering django settings

2011-02-17 Thread Phlip
On Feb 17, 12:03 pm, Cody Django wrote: > For example, I have a captcha that is used in parts of a site that > affects form logic. > The django settings has a variable CAPTCHA = True, which acts as a > switch. > > I'd like to change this setting in the setup for each

Re: Displaying a table and make its columns sortable

2011-02-17 Thread Arun K.Rajeevan
I think, I'm not clear in first place. My confusion revolve around following 1) The table that I display is not constitute a single model from django application. It combine two models from django application and data returned from a web-service. Since web-service included in the recipe, it make

Re: Displaying a table and make its columns sortable

2011-02-17 Thread Tim Sawyer
On 17/02/11 20:18, Arun K.Rajeevan wrote: I've a table which stores unique ids for an object that I've to retrieve via SOAP( I've a url to a WSDL file) service calls. This table also contains some details like last access to this object from application etc. *What I need very badly and

Re: Displaying a table and make its columns sortable

2011-02-17 Thread Shawn Milochik
This sounds like a good time to use jQuery. If all the data is being displayed at once anyway, then it'll be faster and easier to do the filtering and sorting client-side. Even if you're talking about a lot of data, things like the click-sorting of table columns should probably be done with

How to pivot a table?

2011-02-17 Thread Phlip
Djangoists: I have a database table like this... red, 1 red, 2 red, 15 blue, 18 blue, 20 ...and I want to read it into an array like this: [ ['red', [1,2,15]], ['blue', [18,20]], ] Of course I can use values_list('color', 'number'), and then re-pack the array with a for-loop. Do

Displaying a table and make its columns sortable

2011-02-17 Thread Arun K.Rajeevan
I've a table which stores unique ids for an object that I've to retrieve via SOAP( I've a url to a WSDL file) service calls. This table also contains some details like last access to this object from application etc. *What I need very badly and urgently:* I've to display a few items from this

Unit Testing: temporarily altering django settings

2011-02-17 Thread Cody Django
For example, I have a captcha that is used in parts of a site that affects form logic. The django settings has a variable CAPTCHA = True, which acts as a switch. I'd like to change this setting in the setup for each TestCase. The regular unittests tests (in which we are assuming the captcha is

Re: How to Auto fill fields on Save in Django Admin?

2011-02-17 Thread Matteius
Well I have it configured now so that the fields are editable but that when None a default value gets set, either the author=request.user (admin.py layer) and pub_date=datetime.now() when no value is specified. I had to set (null=True, blank=True) for author in order to get past form field

Re: PDF response using wkhtmltopdf.

2011-02-17 Thread Bill Freeman
The return value of Popen isn't the output of the program, but instead is the class instance. I believe that you could provide a cStringIO instance as the 'stdout' keyword argument, and it would capture the program's output. You could them use its getvalue() method's return value as your

Re: Problems Adding Django South Tool

2011-02-17 Thread hank23
Thanks for the help. I found the problem and now I have my migration file(s) and I'm ready to migrate. On Feb 17, 12:07 pm, Shawn Milochik wrote: > On Thu, Feb 17, 2011 at 11:26 AM, hank23 wrote: > > Ok I added the southtut app to my installed apps

Re: External Javascript Files

2011-02-17 Thread David De La Harpe Golden
On 17/02/11 17:44, hank23 wrote: > Is it possible to use external javascript files with a django app? Certainly - The django admin itself does it, for example, bundling a version of jquery and a bunch of stuff in admin/media/js/ > If > so what folder does the javascript file need to be placed

Android mail? (Re: [tueysuezseftali:76683] [android-developers] Select mp3 to play?)

2011-02-17 Thread Nick Arnett
Anybody on django-users know why this mail is coming to our group? It's strange - the "To" header is android-developers, but the reply-to is django-users. I can't quite tell if it is a Google Groups problem or the person posting ( nikola1...@gmail.com). Nick On Thu, Feb 17, 2011 at 8:47 AM,

Re: django CMS 2.1.2 released

2011-02-17 Thread Javier Nievas
Great! I'll need to remove the patch I did to make it work... :-) -- 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 unsubscribe from this group, send email to

Re: site styling works with development server but not apache

2011-02-17 Thread Ashish Agarwal
Progress!! I had to add Alias /adminmedia "/usr/lib/pymodules/python2.6/django/contrib/admin/media" and set ADMIN_MEDIA_PREFIX to the same url /adminmedia/ I don't understand everything yet, and will probably have more problems soon. But at least I got this far. Thanks for all the help!! On

Re: site styling works with development server but not apache

2011-02-17 Thread Mike Ramirez
On Thursday, February 17, 2011 09:23:47 am you wrote: > I'm still having trouble. My directory structure is: > > /usr/local/www/static > > +- contrib/admin/media -- symlink to django/contrib/admin/media > > +- media/admin/base_site.html -- modified version of base_site.html > > I've tried

Re: site styling works with development server but not apache

2011-02-17 Thread Ashish Agarwal
I'm using WSGI and tried your suggestion, but something is still missing. The generated HTML refers for example to a stylesheet href="/media/css/base.css". But this is in the django install directory, which is not being served. So I feel there has to be an Alias pointing there. Even if I did that,

Re: Problems Adding Django South Tool

2011-02-17 Thread Shawn Milochik
On Thu, Feb 17, 2011 at 11:26 AM, hank23 wrote: > Ok I added the southtut app to my installed apps after creating its > folder, but now when I enter this command: > > python manage.py schemamigration southtut --initial > > I get this: > > Unknown command: 'schemamigration'

Re: External Javascript Files

2011-02-17 Thread hank23
Thanks. I'll take a look. On Feb 17, 11:51 am, Marcos Moyano wrote: > you need to put it in your media folder. > > http://docs.djangoproject.com/en/1.2/howto/static-files/ > > Rgds, > Marcos > > > > > > On Thu, Feb 17, 2011 at 2:44 PM, hank23

Re: External Javascript Files

2011-02-17 Thread Marcos Moyano
you need to put it in your media folder. http://docs.djangoproject.com/en/1.2/howto/static-files/ Rgds, Marcos On Thu, Feb 17, 2011 at 2:44 PM, hank23 wrote: > Is it possible to use external javascript files with a django app? If > so what folder does the javascript file

External Javascript Files

2011-02-17 Thread hank23
Is it possible to use external javascript files with a django app? If so what folder does the javascript file need to be placed in? So far I tried putting it in the bas folder of the app. I want to use it in and it doesn't seem to work there if I reference it directly using only just the filename

Re: site styling works with development server but not apache

2011-02-17 Thread Marcos Moyano
This is the relevant VirtualHost configuration for admin media WSGI Alias /media "/usr/local/www/static/media/" Order allow,deny Allow from all MOD_PYTHON SetHandler None If this doesn't work perhaps you shoud could paste your VirtualHost

Re: site styling works with development server but not apache

2011-02-17 Thread Ashish Agarwal
I'm still having trouble. My directory structure is: /usr/local/www/static | +- contrib/admin/media -- symlink to django/contrib/admin/media | +- media/admin/base_site.html -- modified version of base_site.html I've tried every combination of the following, but nothing is working: DocumentRoot

Re: Problems Adding Django South Tool

2011-02-17 Thread hank23
Ok I added the southtut app to my installed apps after creating its folder, but now when I enter this command: python manage.py schemamigration southtut --initial I get this: Unknown command: 'schemamigration' Which makes me wonder if I really do have South completely installed ok, or if I

Missing Related Objects in MODEL._meta.get_all_related_objects

2011-02-17 Thread Martin Siniawski
Hey! So we have a certain model which is related with many other models, by ForeignKey fields set in those other models. The setup is not particularly exotic, but for some reason, when using ._meta.get_all_related_objects() on the model which has all the ForeignKey fields pointing at it, some of

Re: Problems Adding Django South Tool

2011-02-17 Thread Michael
After you create the southtut app, you need to add it to settings.INSTALLED_APPS in order for Django to know about it. If Django doesn't know about it, then South doesn't know about it. -- Michael On Thu, 2011-02-17 at 07:20 -0800, hank23 wrote: > I downloaded and

Re: site styling works with development server but not apache

2011-02-17 Thread Mike Ramirez
On Thursday, February 17, 2011 07:14:16 am ashish wrote: > Hi all. I followed the tutorial to setup a basic django site and run > it with the development server. Everything looks fine. Then, I > configured to use apache. Everything seems to work except the styling. > The login and admin pages have

Re: site styling works with development server but not apache

2011-02-17 Thread Tom Evans
On Thu, Feb 17, 2011 at 3:14 PM, ashish wrote: > Hi all. I followed the tutorial to setup a basic django site and run > it with the development server. Everything looks fine. Then, I > configured to use apache. Everything seems to work except the styling. > The login and

Problems Adding Django South Tool

2011-02-17 Thread hank23
I downloaded and installed Django's South DB tool apparently ok because after installing it I went into the shell and was able to import South ok with no errors. So then I added it to the end of the list of installed apps and also ran syncdb. When I ran syncdb I didn't get anything that looked

site styling works with development server but not apache

2011-02-17 Thread ashish
Hi all. I followed the tutorial to setup a basic django site and run it with the development server. Everything looks fine. Then, I configured to use apache. Everything seems to work except the styling. The login and admin pages have no formatting. On IRC I was told the issue is that the

Re: Having trouble synchronizing the database, can someone help?

2011-02-17 Thread ofri
What you are looking for is: python manage.py reset app_name flush only deletes the data. reset also drops the tables and re-create them. On Feb 17, 7:41 am, Chen Xu wrote: > Sorry, I dont really understand how python manage.py sqlcustom  command > works, can anyone give an

Re: Ajax form in django

2011-02-17 Thread Tom Evans
On Wed, Feb 16, 2011 at 3:16 PM, mf wrote: > Hi, the problem I'm having is that, when I submit the form, the > response is placed in a new url(/feedback) instead of placing it in > the actual(/results) url. The alert never gets executed. > > I guess I'm doing something wrong in

Re: Ajax form in django

2011-02-17 Thread Alendit
Try adding something like $("#feedback_form").attr("action", "") to your create_note function, so that action is reset if javascript gets executed. Alendit -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Toolbar for Django 1.3?

2011-02-17 Thread galago
That helped:) New checkout fixed the problem :) -- 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 unsubscribe from this group, send email to

Re: Virtualenv django project created through ubuntu, checkout out to a windows machine not cross os compatible?

2011-02-17 Thread Tom Evans
On Thu, Feb 17, 2011 at 12:33 PM, mongoose wrote: > Hi, > > I've created a django project with virtualenv on my server. It is an > Ubuntu server. I have checked it into svn. Now I'm on a windows > machine and have checked out the project. I noticed however that the >

Virtualenv django project created through ubuntu, checkout out to a windows machine not cross os compatible?

2011-02-17 Thread mongoose
Hi, I've created a django project with virtualenv on my server. It is an Ubuntu server. I have checked it into svn. Now I'm on a windows machine and have checked out the project. I noticed however that the activate and deactivate scripts are in bash when created through linux and are .bat files

Re: Toolbar for Django 1.3?

2011-02-17 Thread Russell Keith-Magee
On Thu, Feb 17, 2011 at 6:24 PM, galago wrote: > It doesn't work when I switch on the panel for SQL > ('debug_toolbar.panels.sql.SQLDebugPanel',). Without that panel it works. > That's error: > TemplateSyntaxError at / > > Caught AttributeError while rendering: 'Cursor' object

Re: Class-based views & authentication

2011-02-17 Thread Andre Terra
Reported! http://code.djangoproject.com/ticket/15328 Sincerely, André Terra 2011/2/16 Łukasz Rekucki > On 16 February 2011 19:46, Andre Terra wrote: > > I should also add that the functionality described in the docs simply did > > not work for me: >

Re: Ordering/sort_by from a custom method

2011-02-17 Thread Andres Lucena
El jue, 10-02-2011 a las 07:44 -0800, Alex Robbins escribió: > Wow, you are right. This is a tricky lookup. The generic relation > makes it pretty tough. I'd just use the python sort unless you see a > real performance problem. > > class LinkGetTopScores(models.Manager): > def

Re: Toolbar for Django 1.3?

2011-02-17 Thread Mike Ramirez
On Thursday, February 17, 2011 02:40:20 am Daniel Hilton wrote: > On 17 February 2011 10:34, galago wrote: > > I run my sever on localhost (manage.py runserver). > > Is there any way to display all queries in console or somewhere else? > > Yes, if you install dcramer's

Re: Importing modules in code

2011-02-17 Thread Kenneth Gonsalves
On Thu, 2011-02-17 at 02:44 -0800, Daniel Roseman wrote: > > could you elaborate on this? I am suffering from this misconception. > > > Not sure what else to say. Taking mod_wsgi as an example, Apache > spawns a > number of processes and/or threads to serve Django requests, depending > on > your

Re: Importing modules in code

2011-02-17 Thread Daniel Roseman
On Thursday, February 17, 2011 6:37:56 AM UTC, lawgon wrote: > > On Wed, 2011-02-16 at 02:12 -0800, Daniel Roseman wrote: > > Your question betrays a misconception that I often see. Django - at > > least > > when served other than via CGI - does not reload everything for each > > request. The

Re: Toolbar for Django 1.3?

2011-02-17 Thread galago
Thanks, I'll try it :) -- 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 unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more

Re: Toolbar for Django 1.3?

2011-02-17 Thread Daniel Hilton
On 17 February 2011 10:34, galago wrote: > I run my sever on localhost (manage.py runserver). > Is there any way to display all queries in console or somewhere else? Yes, if you install dcramer's devserver, which is a straight replacement for the runserver command. More info

Re: Toolbar for Django 1.3?

2011-02-17 Thread galago
I run my sever on localhost (manage.py runserver). Is there any way to display all queries in console or somewhere else? -- 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

Re: Toolbar for Django 1.3?

2011-02-17 Thread Daniel Hilton
On 17 February 2011 10:24, galago wrote: > It doesn't work when I switch on the panel for SQL > ('debug_toolbar.panels.sql.SQLDebugPanel',). Without that panel it works. > That's error: > TemplateSyntaxError at / > > Caught AttributeError while rendering: 'Cursor' object has

Re: Toolbar for Django 1.3?

2011-02-17 Thread galago
It doesn't work when I switch on the panel for SQL ('debug_toolbar.panels.sql.SQLDebugPanel',). Without that panel it works. That's error: TemplateSyntaxError at / Caught AttributeError while rendering: 'Cursor' object has no attribute 'db' Request Method:GETRequest

Re: Toolbar for Django 1.3?

2011-02-17 Thread Daniel Hilton
On 17 February 2011 10:15, galago wrote: > Is there any working toolbar for Django 1.3? > https://github.com/dcramer/django-debug-toolbar - this doesn't work in my > project based on 1,3 :/ > Doesn't work how? Stack trace or more info please! Cheers, Dan > -- > You received

Toolbar for Django 1.3?

2011-02-17 Thread galago
Is there any working toolbar for Django 1.3? https://github.com/dcramer/django-debug-toolbar - this doesn't work in my project based on 1,3 :/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: ManyToMany problem

2011-02-17 Thread Amar
OK, I've created a barebone app which shows this problem, so if anyone can try this and duplicate, I'll report this as a bug (unless there is a problem wih my code) You can get it here http://rapidshare.com/files/448393624/problem.zip I'm using PostgreSQL database, so change accordingly (unless