Re: django 1.0.2, django_pagination-1.0.5, postgresql, LIMIT & OFFSET question

2009-02-04 Thread Bartek SQ9MEV
Bartek pisze: > so... looks like everytime I need 20 Post items my database is hit by > query returning all records... I find it a big overhead, and my app > suffers from that... Today I'm still investigating this issue, and I've just tried to use Paginator object as described at http://docs.djan

Re: Overriding admin template: index.html

2009-02-04 Thread knight
Hi, Thanks for the fast reply. I read this but I still cannot find the view that renders index.html. Regards, Arshavski Alexander On Feb 4, 9:52 am, Kenneth Gonsalves wrote: > On Wednesday 04 Feb 2009 1:18:53 pm knight wrote: > > > I want to override admin template: index.html. > > I have foun

Re: Changing default app url in development server

2009-02-04 Thread knight
My production version is running on different computer with apache installed on http:///peergw and development version on my computer is running on http://. I want them both to run on http:///peergw. The port has no difference. Thanks, Alex A. On Feb 4, 9:58 am, Ian Lewis wrote: > What are you

Re: Overriding admin template: index.html

2009-02-04 Thread James Bennett
On Wed, Feb 4, 2009 at 2:35 AM, knight wrote: > Thanks for the fast reply. > I read this but I still cannot find the view that renders index.html. You do not need to do anything to the view function. The view you're looking for is designed so that you can place your own custom template (named ap

how to use site administration?

2009-02-04 Thread workingbird
i the database is created successfully, and i can sign in as a super_user. and in model documentation (http://localhost:8000/admin/doc/models/), the 'Account' model can be found. the problem is that, the on Site administration home page ,it is only 2 groups and their models: Auth, Sites. there is

Re: how to use site administration?

2009-02-04 Thread workingbird
the django documents said super user can edit data in site administration. but i can not find how to enter. did i miss something? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this g

Re: Overriding admin template: index.html

2009-02-04 Thread Kenneth Gonsalves
On Wednesday 04 Feb 2009 2:05:37 pm knight wrote: > Thanks for the fast reply. > I read this but I still cannot find the view that renders index.html. well, according to this link, you do not need the view in order to override index.html of admin. -- regards KG http://lawgon.livejournal.com -

Re: how to use site administration?

2009-02-04 Thread Daniel Roseman
On Feb 4, 8:56 am, workingbird wrote: > i the database is created successfully, and i can sign in as a > super_user. > and in model documentation (http://localhost:8000/admin/doc/models/), > the 'Account' model can be found. > the problem is that, the on Site administration home page ,it is only

Re: how to use site administration?

2009-02-04 Thread workingbird
@Daniel thanks a lot. it works! following the document, i add file 'admin.py' under 'myapp', and input "admin.site.register(Account)",it is ok now. On Feb 4, 5:15 pm, Daniel Roseman wrote: > On Feb 4, 8:56 am, workingbird wrote: > > > > > i the database is created successfully, and i can sign

Re: Image Captcha

2009-02-04 Thread Ales Zoulek
Please: 1] stop using this signature 2] give us some details about what you are doing, what exception in raises and traceback. A. 2009/2/4 Harryanto Ie : > i have to create image captcha and i have an error. it's > saying that IOError. what should i do? > =

form is not displaying

2009-02-04 Thread Praveen
http://dpaste.com/116535/ --~--~-~--~~~---~--~~ 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-

comparing values in the same table

2009-02-04 Thread nibudh
Hi, A newbie question here. I'm trying to retrieve all users from the system who are basically fully active. ie. not held or paused, and lastly only select people who have a duration that is greater than the number of 'days' that their contract has been running. The problem seems to be that i'm

Re: django 1.0.2, django_pagination-1.0.5, postgresql, LIMIT & OFFSET question

2009-02-04 Thread Karen Tracey
On Wed, Feb 4, 2009 at 3:01 AM, Bartek SQ9MEV wrote: > > Bartek pisze: > > > so... looks like everytime I need 20 Post items my database is hit by > > query returning all records... I find it a big overhead, and my app > > suffers from that... > Today I'm still investigating this issue, and I've

Re: Changing default app url in development server

2009-02-04 Thread Ales Zoulek
As I undrestood it is that it's infact *used* on Apache. That's why the django project is on "/peergw" - Apache, but "/" - dev server. And Alex wants to simulate this behaviour on dev server side. Or am I wrong? A. On Wed, Feb 4, 2009 at 3:02 PM, Karen Tracey wrote: > On Wed, Feb 4, 2009 at

Re: django problem with include of templates in block as variable

2009-02-04 Thread Ales Zoulek
That should work. http://docs.djangoproject.com/en/dev/ref/templates/builtins/#include Try this: {% extends "main.html" %} {% block test %} CODE: {{code}} {% include code %} {% endblock %} Do you see the code value in the output? On Wed, Feb 4, 2009 at 1:51 PM, Dafidov wrote: > > Hello >

Re: Changing default app url in development server

2009-02-04 Thread Karen Tracey
On Wed, Feb 4, 2009 at 9:11 AM, Ales Zoulek wrote: > > As I undrestood it is that it's infact *used* on Apache. > That's why the django project is on "/peergw" - Apache, but "/" - dev > server. > > That the "/peergw/" is needed to reach the code running on Apache implies the Location block for th

Re: Changing default app url in development server

2009-02-04 Thread Ales Zoulek
> That way, the exact same URL can be used in both places. Yep. But the urls.py cannot :) That was why I suggested the solution with midlleware. Which is conditionaly loaded Example: settings.py: if DEBUG: MIDDLEWARE_CLASSES = ['project.mw.InjectUrlPrefix'] + MIDDLEWARE_CLASSES > > On W

syncdb dry run

2009-02-04 Thread tow
Is there a way to do a dry run of "manage.py syncdb", to see what sql commands it's about to execute? "./manage.py sqlall" isn't good enough for my purposes because 1) I have to specify the list of applications myself (although it's easy enough to write a wrapper which will walk across INSTALLED

Problem activating the admin function.

2009-02-04 Thread MickeSommar
Hi all I'm trying to test django, I using the tutorial frome django: http://docs.djangoproject.com/en/dev/intro/tutorial01/#intro-tutorial01 I'm having problem with the admin-function, urls.py file give me errors. I have read that the tutorial is wrong. I have used the installed files frome djan

FormSet in Wizard

2009-02-04 Thread Austin Gabel
Hello, I am trying to set up a Django FormWizard to add users to my site. On one of the steps I need to be able to enter more than one address. I was hoping to use a FormSet on this step but it does not seem to work as I had expected. The FormSet displays correctly initially, but when I submit

Re: Problem activating the admin function.

2009-02-04 Thread Karen Tracey
On Wed, Feb 4, 2009 at 10:09 AM, MickeSommar wrote: > [snip lots of detail except what turns out to be relevant so it was good to > include it all] > > 11.2 Edeting the urls.py file. > > Uncomment lines: > > from django.conf.urls.defaults import * > > # Uncomment the next two lines to enable t

Re: Django Continuous Integration

2009-02-04 Thread Vitaly Babiy
Has any one got hudson to work as a CI system. Vitaly Babiy On Wed, Jan 14, 2009 at 1:05 PM, Adam V. wrote: > > > Revision Control: How do you layout your development repository? I'm > > using Subversion for my setup but would be interested in hearing what > > else others are using (Mercurial,

Re: Problem activating the admin function.

2009-02-04 Thread MickeSommar
Hi Karen I imagine that it was only the # that should get deletet, the space is thera by default. Thanks fore the tip, it solved my problem. // Micke On 4 Feb, 16:19, Karen Tracey wrote: > On Wed, Feb 4, 2009 at 10:09 AM, MickeSommar wrote: > > [snip lots of detail except what turns out to b

Changing the structure of an already running site

2009-02-04 Thread phyl.jack...@gmail.com
Im fairly new to django and new to databases in general and Im just trying to work out how Im going to make changes to my website once its up and running. Im using mySQL, any time i add a field to one of my models I run syncdb but any calling already created users or comments causes an error. The

Re: Problem activating the admin function.

2009-02-04 Thread Karen Tracey
On Wed, Feb 4, 2009 at 10:32 AM, MickeSommar wrote: > > Hi Karen > > I imagine that it was only the # that should get deletet, the space is > thera by default. > Ah, I see there is a space there also in what's originally in the file, I guess to make it line up nicely. In which case both the # a

Re: Changing the structure of an already running site

2009-02-04 Thread Karen Tracey
On Wed, Feb 4, 2009 at 10:46 AM, phyl.jack...@gmail.com < phyl.jack...@gmail.com> wrote: > > > Im fairly new to django and new to databases in general and Im just > trying to work out how Im going to make changes to my website once its > up and running. > Im using mySQL, any time i add a field to

how to associate django admin user with particular instances of certain model objects

2009-02-04 Thread Michael Repucci
Hi Django'ers! I'm brand new to Django, and I'm totally loving it. But I can't seem to find the answer to a task I've encountered with a site that I'm developing. I'm a moderately experienced Python programmer, only a mediocre web developer, and as I said a newbie with Django, so please pardon me

Re: how to associate django admin user with particular instances of certain model objects

2009-02-04 Thread Karen Tracey
On Wed, Feb 4, 2009 at 10:48 AM, Michael Repucci wrote: > > Hi Django'ers! > > I'm brand new to Django, and I'm totally loving it. But I can't seem > to find the answer to a task I've encountered with a site that I'm > developing. I'm a moderately experienced Python programmer, only a > mediocre w

Re: comparing values in the same table

2009-02-04 Thread Ales Zoulek
Are you using SVN django version, on 1.0? If you're on svn, recently "F" object was finished, that should (to my knowledge) solve just this type of situations... Read more on: http://groups.google.com/group/django-developers/browse_thread/thread/c8cff7e5e16c692a/64f348822f2d43e5?lnk=gst&q=F#64f

Re: how to associate django admin user with particular instances of certain model objects

2009-02-04 Thread Michael Repucci
That was EXACTLY what I was looking for!! Very clear and simple, with links to the documentation. That makes me so happy! Thank you a million times!! On Feb 4, 10:57 am, Karen Tracey wrote: > On Wed, Feb 4, 2009 at 10:48 AM, Michael Repucci wrote: > > > > > > > Hi Django'ers! > > > I'm brand new

Re: FileField and moving or updating files

2009-02-04 Thread timc3
Thanks for the information, its much appreciated. Currently we are not doing anything that special. We use Nginx as our webserver, with the configuration set to receive large files, then django is then sent the file and we are just using the standard method of multiple_chunks() . Everything on N

Re: Changing default app url in development server

2009-02-04 Thread Adam Stein
Ah yes, not being able to change urls.py would make it more difficult. Somebody is making your job way too hard :-{} On Wed, 2009-02-04 at 15:29 +0100, Ales Zoulek wrote: > > That way, the exact same URL can be used in both places. > Yep. But the urls.py cannot :) > > That was why I suggested th

Re: Changing default app url in development server

2009-02-04 Thread Karen Tracey
On Wed, Feb 4, 2009 at 4:46 AM, Ales Zoulek wrote: > > That's not as easy as it seams, quick fix/hack would be middleware > that strips out /pergw from the url. That middleware would be used > only for dev server, not for apache. > > What about simply using the django.root PythonOption when runni

django problem with include of templates in block as variable

2009-02-04 Thread Dafidov
Hello I have this kind of problem: In some child template I want to include in {% block metatags %} other file depending of which link was clicked on page. In view I'm sending as code the name of this variable and when i display it everything is ok - there is this data what I need under this code,

Re: queryset iteration

2009-02-04 Thread Casey
On Feb 3, 6:19 pm, Malcolm Tredinnick wrote: > "Default" iteration over a queryset (using __iter__) also caches the > instances in memory so that they can be reused without requiring extra > database queries. Normally, the memory overhead is negligible, since the > queryset is being used to put r

Re: increasing upload speed

2009-02-04 Thread felix
On Wed, Feb 4, 2009 at 2:48 AM, Malcolm Tredinnick wrote: > So if you're thinking that > those are the bottlenecks, rather than the network, actually I assumed the network *was* the primary bottleneck. I was just inquiring if anybody had experiences to share with uploading large files, and if

Re: Form Data is not saving to database

2009-02-04 Thread Brian Neal
On Feb 3, 11:02 pm, Praveen wrote: > Oops... yeah Brian that i forgot to make it as a foriegn key to the > user table and that might be surprised without making foriegn key i > did not get any error even though my settings.DEBUG is true. but now i > made user field in MemberProfile but the same p

Re: Changing default app url in development server

2009-02-04 Thread Ales Zoulek
That's not as easy as it seams, quick fix/hack would be middleware that strips out /pergw from the url. That middleware would be used only for dev server, not for apache. A. On Wed, Feb 4, 2009 at 9:39 AM, knight wrote: > > My production version is running on different computer with apache >

Image Captcha

2009-02-04 Thread Harryanto Ie
i have to create image captcha and i have an error. it's saying that IOError. what should i do? "Flexi - Gratis bicara sepanjang waktu se-Jawa Barat, Banten dan DKI Jakarta.

Re: Changing the structure of an already running site

2009-02-04 Thread phyl.jack...@gmail.com
Thanks Karen, that post is exactly what I was after. I can go and set one of those projects up if I need to. Phil On 4 Feb, 15:53, Karen Tracey wrote: > On Wed, Feb 4, 2009 at 10:46 AM, phyl.jack...@gmail.com < > > phyl.jack...@gmail.com> wrote: > > > Im fairly new to django and new to database

Re: Changing default app url in development server

2009-02-04 Thread Adam Stein
I do something similiar where I have an extra item in the url. To get Apache and the Django server to match, I just add the extra part in urls.py that I'm matching. So instead of something like: (r'^admin/(.*)', admin.site.root) in Alex's case, it would be: (r'^peergw/admin/(.*)', admin.site.

Optional m2m relationships in Admin

2009-02-04 Thread GeneralMean
This is a huge one: I want to implement an optional m2m realtionship in django admin application, so it is possible to create a new Game (model description below) without choosing any tags associated with it. By default django form validation returns an error when I try to do such thing. So I cre

2nd call for papers: PostgreSQL Conference East

2009-02-04 Thread Joshua D. Drake
PostgreSQL Conference East is being held at historic Drexel University on April 3rd through 5th 2009 . This is the second call for papers. The call for papers ends Feb 23rd and speakers will be notified on the 27th. You may submit your talk here: http://www.postgresqlconference.org . We are lookin

Newbie question: first project can't connect to MySQL

2009-02-04 Thread Kevin Audleman
Hello everyone, I am running through the tutorial and setting up my first django project. Quite exciting! However I have run into trouble connecting to MySQL. My settings.py file looks like this: DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'or

Re: Newbie question: first project can't connect to MySQL

2009-02-04 Thread Kevin Audleman
I found the solution in the archives: I changed DATABASE_HOST to 127.0.0.1 from '' Kevin On Feb 4, 9:41 am, Kevin Audleman wrote: > Hello everyone, > > I am running through the tutorial and setting up my first django > project. Quite exciting! However I have run into trouble connecting to > MyS

Re: Optional m2m relationships in Admin

2009-02-04 Thread garagefan
Not totally sure this will help with your error, as i haven't come across it yet. But for fields that may be empty I also have a blank = True and null = True. This is to tell the DB that it is acceptable to have no value in the field. ie, i'm using the following to choose add users to a private

how to sync database upon change in field attribute ?

2009-02-04 Thread xankya
class Bookmark(models.Model): title = models.CharField(max_length=200, unique=True) user = models.ForeignKey(User) link = models.ForeignKey(Link) I need to remove "unique=True" attribute. I guess "manage.py syncdb won't do this". So can anyone help me? --~--~-~--~-

Modifying Handler to support multiple customized, inheriting clients

2009-02-04 Thread bbeaudreault
Ok, yea. Sorry for the title, it is hard to generalize this question enough to be short like that. Anyway, at the company I work at we use mod_perl, and we have clients. Our code-base is set up like this: Shared Code -> Client Code The client code inherits and overrides shared code. So if in

Re: Modifying Handler to support multiple customized, inheriting clients

2009-02-04 Thread bbeaudreault
Note: I could just make one big app, and deploy it separately for all my clients. But I want to be able to easily roll out big changes to all my clients, without having to replicate code a manually across them. That's why a Shared -> Client inheritance handler type of thing would work perfectly

Re: how to sync database upon change in field attribute ?

2009-02-04 Thread Karen Tracey
On Wed, Feb 4, 2009 at 1:26 PM, xankya wrote: > > class Bookmark(models.Model): >title = models.CharField(max_length=200, unique=True) >user = models.ForeignKey(User) >link = models.ForeignKey(Link) > > I need to remove "unique=True" attribute. I guess "manage.py syncdb >

Re: Optional m2m relationships in Admin

2009-02-04 Thread GeneralMean
Thanks for the answer, I modified my Game model according to your suggestion, and also, simplified whole thing. I can create new game without having to choose any tags - that's correct. Now, take a look at the save_model() method in GamesAdmin - I try to associate newly created Game with some tag

form validation in XMLHttp submission

2009-02-04 Thread adrian
I'm using the standard pattern for handling a POST request form submission, even though the form is submitted by JavaScript as an XMLHttpRequest, and the date validation is not working. I added some logging statements to find the problem and I get the error message "MyModelForm' object has no

'NoneType' object has no attribute 'rfind'

2009-02-04 Thread bfellows
I've run into what strikes me as an odd exception when using the gdata- python-client library in Django 1.0 on Python 2.5 and the dev environment server. For context, this is a very simple sandbox app for playing with the picasa web album API. It contains no data models. I have my urls set up to

Re: Optional m2m relationships in Admin

2009-02-04 Thread garagefan
>From my limited understanding of Django... the admin.py stuff should not contain any save function. http://docs.djangoproject.com/en/dev/ref/contrib/admin/#ref-contrib-admin what exactly are you trying to do with the tag? Your M2M field in the initial Game class creates the relationship. You

Re: 'NoneType' object has no attribute 'rfind'

2009-02-04 Thread bfellows
Traceback: File "/var/lib/python-support/python2.5/django/core/handlers/base.py" in get_response 86. response = callback(request, *callback_args, **callback_kwargs) File "/var/django/.../views.py" in display 33. photos = gd_client.GetFeed(f) File "/usr/lib/python2.5/site-packages/gdata/photos/serv

Re: how to sync database upon change in field attribute ?

2009-02-04 Thread xankya
I am using MySql. Karen Tracey wrote: > On Wed, Feb 4, 2009 at 1:26 PM, xankya wrote: > > > > > class Bookmark(models.Model): > >title = models.CharField(max_length=200, unique=True) > >user = models.ForeignKey(User) > >link = models.ForeignKey(Link) > > > > I need to re

Re: 'NoneType' object has no attribute 'rfind'

2009-02-04 Thread Karen Tracey
On Wed, Feb 4, 2009 at 2:37 PM, bfellows wrote: > > Traceback: > File "/var/lib/python-support/python2.5/django/core/handlers/base.py" > in get_response > 86. response = callback(request, *callback_args, **callback_kwargs) > File "/var/django/.../views.py" in display > 33. photos = gd_client.GetF

Re: Optional m2m relationships in Admin

2009-02-04 Thread koenb
>     def save_model(self, request, obj, form, change): >         super(GamesAdmin, self).save_model(request, obj, form, change) >         if not change: >             #get a tag >             tag = Tags.objects.get(pk=1) >             #associate tag with newly created object >             obj.tag

Re: Optional m2m relationships in Admin

2009-02-04 Thread GeneralMean
On 4 Lut, 20:24, garagefan wrote: > From my limited understanding of Django... > > the admin.py stuff should not contain any save function. > > http://docs.djangoproject.com/en/dev/ref/contrib/admin/#ref-contrib-a... Hmm, take a look at this then: http://docs.djangoproject.com/en/dev/ref/contrib

Form submission not working

2009-02-04 Thread Felipe Sodré Silva
Hello all. I'm facing a really weird problem here. I have this template: alert('post : {{ post }}'); and this view for the template: def jstest(request): post = request.POST.get('bla', 'no posts') if request.method != 'POST': post = 'No post data sent' ret

Re: how to sync database upon change in field attribute ?

2009-02-04 Thread Karen Tracey
On Wed, Feb 4, 2009 at 1:26 PM, xankya wrote: > > class Bookmark(models.Model): >title = models.CharField(max_length=200, unique=True) >user = models.ForeignKey(User) >link = models.ForeignKey(Link) > > I need to remove "unique=True" attribute. I guess "manage.py syncdb >

Re: Optional m2m relationships in Admin

2009-02-04 Thread GeneralMean
>On 4 Lut, 20:52, koenb wrote: > Shouldn't this be obj.tags.add(tag) ? (your m2mfield is called tags > not tag) Typo... It actually should say obj.tag.add(tag) - I wasn't pasting this code, wrote it by hand ;) Actual code has no syntax errors :) --~--~-~--~~~---~--~--

Re: Form submission not working

2009-02-04 Thread Felipe Sodré Silva
Never mind. I should have used name='bla' instead of id='bla'. On Wed, Feb 4, 2009 at 5:59 PM, Felipe Sodré Silva wrote: > Hello all. I'm facing a really weird problem here. > > I have this template: > > alert('post : {{ post }}'); > > > > > > > > and this view for the templat

Re: Optional m2m relationships in Admin

2009-02-04 Thread garagefan
check out django-tagging. It looks like they're using a custom Manager that is handling the creation of new tags based off of an object that is using "tags" listing new tags. On Feb 4, 3:04 pm, GeneralMean wrote: > >On 4 Lut, 20:52, koenb wrote: > > Shouldn't this be obj.tags.add(tag) ? (your m

Admin widget for geotagging

2009-02-04 Thread Anders
Hi. I am in desperat need for a admin widget that let's my users search for an address (via google geocode) and select one of the results google provide or click in a google map to specify a position. This position should then be saved in two separate fields (latitude and longitude). I've been ac

Admin site / save_as won't work with inlines?

2009-02-04 Thread 3lancer.eu
Hi everyone, Is there no chance to make save_as work with inlines? If so, is this going to be fixed in upcoming releases? Regards, Piotr --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: Admin widget for geotagging

2009-02-04 Thread Cesar Mojarro
are u paying someone for this On Wed, Feb 4, 2009 at 2:55 PM, Anders wrote: > > Hi. I am in desperat need for a admin widget that let's my users > search for an address (via google geocode) and select one of the > results google provide or click in a google map to specify a position. > Th

Re: ImageField, width_field, height_field not working

2009-02-04 Thread vicvicvic
Hello! I have created a ticket for this issue, with a patch which solves it. I don't think it breaks anything... http://code.djangoproject.com/ticket/10196 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django us

Re: Optional m2m relationships in Admin

2009-02-04 Thread GeneralMean
On 4 Lut, 21:25, garagefan wrote: > check out django-tagging. It looks like they're using a custom Manager > that is handling the creation of new tags based off of an object that > is using "tags" listing new tags. Will do. Meantime, let's take a look again at the weirdest thing: this DOES work

Where to place files on apache server.

2009-02-04 Thread djandrow
Hello everyone, I've recently installed apache and mod_python and i've managed to run a couple of python files, so i guess its working. I've also created a view, which displays a simple hello world message. I've tested this with the django server and it works. But i'm not sure how to get this to

Re: ImageField, width_field, height_field not working

2009-02-04 Thread alex.gay...@gmail.com
On Feb 4, 3:48 pm, vicvicvic wrote: > Hello! > > I have created a ticket for this issue, with a patch which solves it. > I don't think it breaks anything... > > http://code.djangoproject.com/ticket/10196 That patch does indeed look to be correct, if you haven't already run the test suite to en

Re: NetBeans IDE for Python

2009-02-04 Thread phillc
mine wasnt working exactly as you all described it... until i moved my django symlink to someplace else on my python path... and it suddenly worked its really odd. On Feb 3, 12:49 am, mrsixcount wrote: > Can't seem to get the auto complete to work when I import > django.db.models as models.

Re: Admin site / save_as won't work with inlines?

2009-02-04 Thread Karen Tracey
On Wed, Feb 4, 2009 at 3:56 PM, 3lancer.eu wrote: > > Hi everyone, > > Is there no chance to make save_as work with inlines? If so, is this > going to be fixed in upcoming releases? > There's a ticket reporting the problem: http://code.djangoproject.com/ticket/9651 which even links to another

Django Templates: Dynamically addressing 2-D Dictionary

2009-02-04 Thread Glen Jarvis
I'm banging my head up against a wall on something. Pretty printed, here is the grant object that I created and am passing to my Django Template: {2L: {63L: [, ]}, 4L: {79L:[]} This object is an instance of a sub-classed dictionary: class GrantsDict(dict): program_are

Re: Where to place files on apache server.

2009-02-04 Thread Benjamin Wohlwend
Hi, On Feb 4, 10:08 pm, djandrow wrote: > Hello everyone, > > [...] > > I created a file in Htdocs then in that created the project with the > views and urls.py and the others. > But if I go > onhttp://localhost:8080/myproject/helloorhttp://localhost:8080/myproject/hello/I > get a 404 not foun

MultipleChoiceField issue

2009-02-04 Thread Bobby Roberts
Hi all. I'm using python2.5 / django .96x (yes i know - we're upgrading soon). I have an issue with a multiplechoice field which I can't figure out. Here are snippets from the form: # disaster choices previously defined Disaster=forms.MultipleChoiceField (required=True, choices=Disast

Re: syncdb dry run

2009-02-04 Thread Russell Keith-Magee
On Wed, Feb 4, 2009 at 11:57 PM, tow wrote: > > Is there a way to do a dry run of "manage.py syncdb", to see what sql > commands it's about to execute? > > "./manage.py sqlall" isn't good enough for my purposes because > > 1) I have to specify the list of applications myself > (although it's easy

Re: MultipleChoiceField issue

2009-02-04 Thread Karen Tracey
On Wed, Feb 4, 2009 at 5:32 PM, Bobby Roberts wrote: > > Hi all. I'm using python2.5 / django .96x (yes i know - we're > upgrading soon). I have an issue with a multiplechoice field which I > can't figure out. Here are snippets > > > from the form: ># disaster choices previously defined >

New Django user: how to keep table infomation updating

2009-02-04 Thread Webber Lin
Hi all, I need to create a table, and this table has 3 attributes: Name, Host name, and baseline. I want to make a table able to display dynamic contents when I choose different baseline and click a "check" button. My design is: Baseline is a set of combo-box and button. Resource table shows

New Django user question: how to keep table infomation updating

2009-02-04 Thread webbo
Hi all, I need to create a table, and this table has 3 attributes: Name, Host name, and baseline. I want to make a table able to display dynamic contents when I choose different value from baseline combo-box and click on "check" button. My design is: Baseline is a set of combo-box and button

Re: Django Templates: Dynamically addressing 2-D Dictionary

2009-02-04 Thread Russell Keith-Magee
On Thu, Feb 5, 2009 at 7:30 AM, Glen Jarvis wrote: > > Notice that I can reference grants.2.63 through direct reference, but > when trying to use the variables alpha=2, and beta=63, this lookup > fails. Yes - it will. > I'm beating my head up against the wall with this. Could anyone send > me s

Serialization

2009-02-04 Thread issya
I have a page that displays 16 houses and relevant information. It also displays a Google Map with all of the markers to houses on it. Right now I have it doing a jQuery ajax load and it loading new information to 2 separate divs, thus making 2 separate requests. I know this isn't the best way to

Re: Modifying Handler to support multiple customized, inheriting clients

2009-02-04 Thread bbeaudreault
Sorry to spam, but in re-reading my post I realized that I assumed people know what I mean by "Shared Code." Basically I would have one main code-base that will contain code that all clients inherit from. By default a client would just be running straight off that "shared" code-base, so 2 new cl

Re: Django Templates: Dynamically addressing 2-D Dictionary

2009-02-04 Thread Glen Jarvis
>> I'm beating my head up against the wall with this. Could anyone send >> me some guidance? > > The short version is "You can't do that" - at least, not in the way > you expect. > > Django's template language specifically tries to avoid being a > programming language, and one of the things tha

Recent admin redirect url error?

2009-02-04 Thread Adam Yee
I'm experiencing Change password / Logout redirect errors while trying to logout or change the password. The 404 messages show below: Request Method: GET Request URL:http://127.0.0.1/admin/admin/logout/ It's adding in an extra ^admin/ Same for Change password: Request URL:http:/

Re: Recent admin redirect url error?

2009-02-04 Thread Adam Yee
Using Django version 1.1 pre-alpha SVN-9805 On Feb 4, 4:44 pm, Adam Yee wrote: > I'm experiencing Change password / Logout redirect errors while trying > to logout or change the password. > > The 404 messages show below: > Request Method:         GET > Request URL:    http://127.0.0.1/admin/admi

Re: Recent admin redirect url error?

2009-02-04 Thread Karen Tracey
On Wed, Feb 4, 2009 at 7:44 PM, Adam Yee wrote: > > I'm experiencing Change password / Logout redirect errors while trying > to logout or change the password. > > The 404 messages show below: > Request Method: GET > Request URL:http://127.0.0.1/admin/admin/logout/ > > It's adding in a

Getting uploaded file content type in model save

2009-02-04 Thread Brian Morton
I am working with PIL to resize and thumbnail images during a model save method. I am using SimpleUploadedFile as a wrapper to facilitate the thumbnail field's save method. SimpleUploadedFile requires that the proper content type be passed in as an argument. The trouble is, I may be working wit

Basic Queryset issue

2009-02-04 Thread CALdan
Hi, I'm in the process of learning django by creating a simple application for use at work, I'm using the djangobook's tutorials as guidlines for my own app. As far as I can tell, everything below is correct however when django loads the page in the browser there is no data from within the FOR l

Re: MultipleChoiceField issue

2009-02-04 Thread Bobby Roberts
> I'd guess you need to be calling getlist rather than get to pull all the > various values from the POST data.  (Which is a detail you wouldn't need to > worry about if you were using the standard form clean() framework...not sure > why you are seemingly winging it on cleaning form data instead o

Re: Changing default app url in development server

2009-02-04 Thread Graham Dumpleton
On Feb 5, 1:25 am, Adam Stein wrote: > I do something similiar where I have an extra item in the url.  To get > Apache and the Django server to match, I just add the extra part in > urls.py that I'm matching.  So instead of something like: > > (r'^admin/(.*)', admin.site.root) > > in Alex's cas

Re: form validation in XMLHttp submission

2009-02-04 Thread Malcolm Tredinnick
On Wed, 2009-02-04 at 11:23 -0800, adrian wrote: > > I'm using the standard pattern for handling a POST request form > submission, even though the form is submitted by JavaScript as an > XMLHttpRequest, and the date validation is not working. I added some > logging statements to find the prob

Re: Modifying Handler to support multiple customized, inheriting clients

2009-02-04 Thread Russell Keith-Magee
On Thu, Feb 5, 2009 at 8:39 AM, bbeaudreault wrote: > > Sorry to spam, but in re-reading my post I realized that I assumed > people know what I mean by "Shared Code." That's not the unclear bit. The unclear bit is your terminology and how your are interpreting it. What, exactly, is a "Django han

Re: Basic Queryset issue

2009-02-04 Thread Malcolm Tredinnick
On Wed, 2009-02-04 at 18:02 -0800, CALdan wrote: > Hi, > > I'm in the process of learning django by creating a simple application > for use at work, I'm using the djangobook's tutorials as guidlines for > my own app. As far as I can tell, everything below is correct however > when django loads t

Re: MultipleChoiceField issue

2009-02-04 Thread Karen Tracey
On Wed, Feb 4, 2009 at 9:59 PM, Bobby Roberts wrote: > > > I'd guess you need to be calling getlist rather than get to pull all the > > various values from the POST data. (Which is a detail you wouldn't need > to > > worry about if you were using the standard form clean() framework...not > sure

Re: Serialization

2009-02-04 Thread Russell Keith-Magee
On Thu, Feb 5, 2009 at 8:35 AM, issya wrote: > > My ideal situation would be to initially load the data through ajax > and update through ajax. But I cannot find an easy way to do this. If > I searialize the data, I don't see an easy way to deserialize it. Are you aware of the following: http:/

Re: MultipleChoiceField issue

2009-02-04 Thread Malcolm Tredinnick
On Wed, 2009-02-04 at 18:59 -0800, Bobby Roberts wrote: [...] > Can you provide me an example of how I should be using getlist? I > don't see anything in the docs related to forms and getlist. That's because getlist() has nothing to do with forms. It's a method on the object that is request.POST

'AdminSite' object has no attribute 'urls' issue

2009-02-04 Thread jason
hello all. i followed the django tutorial, to the second part ,when activate the admin site, typing url 'http://localhost:8000/admin/' in the browser's address bar, this error showed up. my django version is 1.0.2, and python version is 2.6, using sqlite3. are there any configurations wrong with t

Re: Serialization

2009-02-04 Thread issya
Thanks for the reply. I was aware of that but I guess I don't understand how to go about using it. I do understand that I can serialize a queryset. But I cannot just go and use the serialized data as template context. From the options I've seen, it looks like if I did something like that I would h

Re: 'AdminSite' object has no attribute 'urls' issue

2009-02-04 Thread Alex Gaynor
On Wed, Feb 4, 2009 at 11:05 PM, jason wrote: > > hello all. > i followed the django tutorial, to the second part ,when activate the > admin site, typing url 'http://localhost:8000/admin/' in the browser's > address bar, this error showed up. > my django version is 1.0.2, and python version is 2.

  1   2   >