Re: pagination problem with "Next" and saving results as a dictionary

2009-03-11 Thread Micah Ransdell
Jesse, The error you are getting is from "q" not being in your post QueryDictionary. This happens because when you click next you are not rePOSTing the q variable. Either you can put the q variable into an input box and POST it again by making your next link a submit button, or you could change q

Re: Trouble with Chapter 7 in Version 1.0 book

2009-03-11 Thread Karen Tracey
On Wed, Mar 11, 2009 at 8:37 PM, John Maines wrote: > We are making our way through the Django book, web version, for 1.0. > We hit a road block at chapter 7, Forms. > > In the part subtitled "A Simple Form Handling Example", there are some > very basic instruction on

Re: Background Jobs

2009-03-11 Thread prestontimmons
If you don't mind setting up your jobs as manage.py commands you can use django-chronograph to manage them as cron jobs through the admin console. Output from each job is stored in a log table in the database. http://code.google.com/p/django-chronograph/ Note that this application depends on a

Re: basic newbie question

2009-03-11 Thread nixon66
Thanks On Mar 11, 11:36 pm, Alex Gaynor wrote: > On Wed, Mar 11, 2009 at 10:34 PM, nixon66 wrote: > > > Here is the view, which works fine. Trying to write another that's > > similar but wanted to try out in shell first. > > > def

Re: Django critter helps us code at the speed of light.

2009-03-11 Thread Malcolm Tredinnick
On Wed, 2009-03-11 at 11:10 -0700, Eric Walstad wrote: [...] > I don't think she realizes it, but Django also helps pay the bills and > puts a smile on her dad's face. > > Now you can have your pony AND a Django Critter: > http://starship.python.net/~ewalstad/django_critter.html Damn. That's

Re: Basic django snafu from a noob

2009-03-11 Thread Malcolm Tredinnick
On Wed, 2009-03-11 at 14:50 -0700, Steve Chervitz Trutane wrote: > I believe I may have hosed my django installation while I was trying > to get up and running with Pinax. I'm working from the django trunk > (1.1alpha) on linux. Here's what happens now when I try to fire up a > new django

Re: Unknown column in field list

2009-03-11 Thread Malcolm Tredinnick
On Wed, 2009-03-11 at 13:55 -0700, mike171562 wrote: > Hello, I tried to add a column to one of my models named Ticket. I ran > a syncdb with no errors, but when i load my app I get the following > error. If you change a model that already exists in the database, "syncdb" will not do anything.

Odd integrity error behavior when saving data

2009-03-11 Thread Margie
I have a Tile model that contains a foreign to a Chip: class Tile(models.Model): name=models.CharField(max_length=NAME_LENGTH) chip = models.ForeignKey(Chip) I find that I get an integrity error if I create a tile that refers to a chip that has not yet been saved: >>> c =

Re: garbage collection on models after use?

2009-03-11 Thread Crispin Wellington
That would be it! Thanks! Crispin On Wed, 2009-03-11 at 21:31 +1100, Malcolm Tredinnick wrote: > On Wed, 2009-03-11 at 08:13 +, Crispin Wellington wrote: > > Hello, > > > > I have a surprisingly simple bit of code, injecting data into a database > > via django's ORM. The "Hit" table has

Django and google app engine

2009-03-11 Thread Guri
Hi, Please if anyone can put light on the best way to upload a running(developed) Django application to Google app engine? 1. appengine-django-helper application 2. Using standard process with appcfg.py or any other method which requires minimum changes in project code. Thanks in

Trouble with Chapter 7 in Version 1.0 book

2009-03-11 Thread John Maines
Hello, We are making our way through the Django book, web version, for 1.0. We hit a road block at chapter 7, Forms. In the part subtitled "A Simple Form Handling Example", there are some very basic instruction on building a form that include making a view, adding some code to urls.py, and

Re: Problem Installing Fixture: Unbound Prefix

2009-03-11 Thread Chris
Note, I also get a similar error for loading JSON: ValueError: No JSON object could be decoded On Mar 11, 7:54 pm, Chris wrote: > I'm using Django 1.0.2, and I dumped out a sample database as XML > using dumpdata. When I run my unittests using this XML as a fixture, I >

login_required

2009-03-11 Thread juanefren
Few times when I open any page in my site this error appears. Caught an exception while rendering: name 'login_required' is not defined. Reloading page solves the problem, and rarely occurs again. I am using @login_required() over all my functions and imported from

Survey systems

2009-03-11 Thread shacker
As far as I can tell, django-survey is the only pluggable survey app available for Django right now. It's off to good start, but is still very buggy, and lacks a lot of the reporting tools and field options found in competing apps for other frameworks/CMSs. Unfortunately some of the bugs I filed

Problem Installing Fixture: Unbound Prefix

2009-03-11 Thread Chris
I'm using Django 1.0.2, and I dumped out a sample database as XML using dumpdata. When I run my unittests using this XML as a fixture, I get the error: Problem installing fixture '/workspace/project/main/fixtures/ simple.xml': Traceback (most recent call last): File

Re: FormWizard problem.

2009-03-11 Thread dmishe
FIXED: i had to add a dummy value to initial form_list of FormWizard so it thinks that it always has two forms :/ On 12 Бер, 00:34, Dmitry Shevchenko wrote: > Hi, > > I have a very strange problem with FormWizard class. I have a two-step > registration process, first form is

Re: Django critter helps us code at the speed of light.

2009-03-11 Thread Russell Keith-Magee
On Thu, Mar 12, 2009 at 3:10 AM, Eric Walstad wrote: > > Now you can have your pony AND a Django Critter: > http://starship.python.net/~ewalstad/django_critter.html > > I hope you all enjoy Django as much as we have. Thanks Eric. That really brightened up my morning. Yours,

Re: Help with adding custom validation to the admin

2009-03-11 Thread Alex Gaynor
On Wed, Mar 11, 2009 at 5:42 PM, Vincent wrote: > > Hi all: > > I am just getting started with Django and could really use some > initial help. My first hurdle is this: I would like to have the act of > choosing a file automatically propagate several of fields of my model.

Help with adding custom validation to the admin

2009-03-11 Thread Vincent
Hi all: I am just getting started with Django and could really use some initial help. My first hurdle is this: I would like to have the act of choosing a file automatically propagate several of fields of my model. Bellow is an example of the model of interest here: ##models.py from django.db

Background Jobs

2009-03-11 Thread Mad Sweeney
Hello, Is there an existing Django app that does: * Allows users to run predefined jobs (shell scripts, SQL etc.) in the background. * Allows users to view the status of jobs: (Running, Scheduled, Completed). * Allows users to view the output from jobs (spreadsheets, reports, log files).

Re: multiple views and templates

2009-03-11 Thread Alex Gaynor
On Wed, Mar 11, 2009 at 4:54 PM, AKK wrote: > > Hello, > > I have a number of views and templates and a list of categories which > i get from my models using: > > categories_list = categories.objects.all() > > Since i need to display this in multiple (but not all)

FormWizard problem.

2009-03-11 Thread Dmitry Shevchenko
Hi, I have a very strange problem with FormWizard class. I have a two-step registration process, first form is predefined, second if dynamic and inserted like this: def process_step(self, request, form, step): if step == 0 and form.is_valid(): region_form = make_form(foo)

[ANN] Pyjamas 0.5 Web Widget Set and python-to-javascript Compiler released

2009-03-11 Thread lkcl
folks, hi, as a django user, i can't help but let people who use my favourite web server framework know of the pyjamas 0.5 release. in addition to the release notes (copy here) : http://groups.google.com/group/comp.lang.python/browse_thread/thread/f1c9e1d2fb251c4e# there is further information

multiple views and templates

2009-03-11 Thread AKK
Hello, I have a number of views and templates and a list of categories which i get from my models using: categories_list = categories.objects.all() Since i need to display this in multiple (but not all) templates is there a better way to achieve this than just putting; categories_list =

Basic django snafu from a noob

2009-03-11 Thread Steve Chervitz Trutane
I believe I may have hosed my django installation while I was trying to get up and running with Pinax. I'm working from the django trunk (1.1alpha) on linux. Here's what happens now when I try to fire up a new django project (a la the turorial): $ django-admin.py startproject mysite $ cd mysite

Unknown column in field list

2009-03-11 Thread mike171562
Hello, I tried to add a column to one of my models named Ticket. I ran a syncdb with no errors, but when i load my app I get the following error. (1054, "Unknown column 'tickets_ticket.ext_email' in 'field list'"). I tried dropping my Database and recreating to no avail. Anyone know about this

Re: Open uploaded file while still in memory; In the Form Clean method?

2009-03-11 Thread Rajesh D
On Mar 11, 12:57 pm, Ty wrote: > I need to validate an uploaded XML file in my Form clean method, but > I'm unable to open the file for validation. It seams, in the clean > method, the file hasn't yet been moved from memory (or the temporary > directory) to the

redirect module...

2009-03-11 Thread RavenJade2006
I had a fantastic developer design an e-commerce site for me in Django. As the last year has progressed the site has been added to and continually developed by both he and myself. When he originally laid out the foundation of the site, there was a redirect module installed. However when I went

pagination problem with "Next" and saving results as a dictionary

2009-03-11 Thread Jesse
The following code is for a search on q and attaches tuples from the search on another model. The search results are appended together to create the final data results "list". def Bypub(request): query = request.POST['q'] if query: qset = (

Re: Validating interdependent inlines

2009-03-11 Thread David Gouldin
Thanks for the suggestion, Alex. I'm having trouble determining where to hook into inline validation using a ModelAdmin method override. As far as I can tell, a list of inline formsets is created and then validated using django.forms.formsets.all_valid in the add_view and change_view methods of

Django critter helps us code at the speed of light.

2009-03-11 Thread Eric Walstad
It occurred to me that my 9yr old daughter has been listening to me talk about Django for almost half of her life. She sees me reading books and blogs about Django. She sees me wear my green DjangoCon t- shirt. For the last 4 years Django's had some influence on her, too. Last night she was

Re: confused about a domain only request

2009-03-11 Thread Dries Desmet
2009/3/6 Malcolm Tredinnick > > On Thu, 2009-03-05 at 13:35 +0100, Dries Desmet wrote: > > Hi all, Hi Malcolm, By reading your reply I realise I almost wrote a rumbling e-mail without thinking too much, but bare with me, I feel that communicating my thoughts is

Re: Accessing fields on uninstantiated model

2009-03-11 Thread Alex Jillard
Ah, that makes sense, thanks. With that change, I can use _meta.fields from my other model and everything works great. Thanks for the help On Wed, Mar 11, 2009 at 12:53 PM, Alex Gaynor wrote: > > > On Wed, Mar 11, 2009 at 11:50 AM, Alex Jillard wrote:

Open uploaded file while still in memory; In the Form Clean method?

2009-03-11 Thread Ty
I need to validate an uploaded XML file in my Form clean method, but I'm unable to open the file for validation. It seams, in the clean method, the file hasn't yet been moved from memory (or the temporary directory) to the destination directory. For example the following code would fail because

Re: Accessing fields on uninstantiated model

2009-03-11 Thread Alex Gaynor
On Wed, Mar 11, 2009 at 11:50 AM, Alex Jillard wrote: > If I override get_form in ShelfAdmin, I still get the same errors. > self.fields is still None...any idea how to get access to the fields? > > On Wed, Mar 11, 2009 at 12:26 PM, Alex Gaynor wrote: >

Re: Accessing fields on uninstantiated model

2009-03-11 Thread Alex Jillard
If I override get_form in ShelfAdmin, I still get the same errors. self.fields is still None...any idea how to get access to the fields? On Wed, Mar 11, 2009 at 12:26 PM, Alex Gaynor wrote: > > > On Wed, Mar 11, 2009 at 11:18 AM, Alex Jillard wrote: >

Simple Dynamic Form Problem

2009-03-11 Thread Alex G
Having referenced http://www.b-list.org/weblog/2008/nov/09/dynamic-forms/, I set about in an attempt to make a dynamic form through a simple change to __init__, but not all is well... My code is simply: .class RFSInputForm(forms.Form): .def __init__(self, rfs, *args, **kwargs): #test init

Re: Accessing fields on uninstantiated model

2009-03-11 Thread Alex Gaynor
On Wed, Mar 11, 2009 at 11:18 AM, Alex Jillard wrote: > Sorry Alex, I should have been more clear, I need to access the fields of > another model. I went ahead and did what you said to try and get it > working, and I was able to get the fields from the form's model, but I get

Re: Accessing fields on uninstantiated model

2009-03-11 Thread Alex Jillard
Sorry Alex, I should have been more clear, I need to access the fields of another model. I went ahead and did what you said to try and get it working, and I was able to get the fields from the form's model, but I get an error when trying to assign them to the choices property of my field. The

filter through two models to subset list

2009-03-11 Thread Jesse
class Pathology(models.Model): pathology = models.CharField(max_length=100, null=True, blank=True) class Pathpubcombo(models.Model): pathology = models.ForeignKey(Pathology) publication = models.ForeignKey(Publication) Currently, I select all the pathologies from the model

Re: Overriding UserManager

2009-03-11 Thread koranthala
On Mar 11, 8:34 pm, Alex Gaynor wrote: > On Wed, Mar 11, 2009 at 10:32 AM, koranthala wrote: > > > Hi, > >    I have created an Identity Mapper for my website - which is as > > follows: > > > class IdentityMap(object): > >    def __getattr__(self,

Re: Accessing fields on uninstantiated model

2009-03-11 Thread Alex Gaynor
On Wed, Mar 11, 2009 at 10:33 AM, Alex Jillard wrote: > I'm trying to populate an admin form with the field names of of a model > class, but I don't want to have to instantiate that model just to read it's > fields from _meta. > > I basically want to do something like this: > >

Re: Overriding UserManager

2009-03-11 Thread Alex Gaynor
On Wed, Mar 11, 2009 at 10:32 AM, koranthala wrote: > > Hi, >I have created an Identity Mapper for my website - which is as > follows: > > class IdentityMap(object): >def __getattr__(self, name): >if not hasattr(self, name): >setattr(self, name,

Accessing fields on uninstantiated model

2009-03-11 Thread Alex Jillard
I'm trying to populate an admin form with the field names of of a model class, but I don't want to have to instantiate that model just to read it's fields from _meta. I basically want to do something like this: self.fields['sort_by'].choices = [(field.verbose_name, field.name) for field in

Re: Does django support RESTful webservice and JSON encoding/decoding?

2009-03-11 Thread lkcl
On Mar 11, 7:40 am, Joshua Partogi wrote: > Dear all, > > Does django support RESTful webservice meaning that I can invoke the > Http method with RESTful URL? > > Another thing does django supports JSON encoding and decoding? if you mean "is there a module available

Re: garbage collection on models after use?

2009-03-11 Thread Alex Gaynor
On Wed, Mar 11, 2009 at 5:31 AM, Malcolm Tredinnick < malc...@pointy-stick.com> wrote: > > On Wed, 2009-03-11 at 08:13 +, Crispin Wellington wrote: > > Hello, > > > > I have a surprisingly simple bit of code, injecting data into a database > > via django's ORM. The "Hit" table has 1.5 million

Re: Post Save Signal the best plan?

2009-03-11 Thread Alex Gaynor
On Wed, Mar 11, 2009 at 4:47 AM, Alfonso wrote: > > Hi there, > > I've got a few tax calculations running on a custom save method within > admin which work great but I need to build in the option to override > these calculations manually. > > So I have 2 questions - is

Re: Validating interdependent inlines

2009-03-11 Thread Alex Gaynor
On Wed, Mar 11, 2009 at 6:40 AM, David Gouldin wrote: > > I have an admin class with a couple of inlines, and I need to validate > that either one or the other has at least one instance populated. > Since each inline has its own separate form in newforms admin, I'm > having

Custom validation for inline formset in Admin

2009-03-11 Thread ljholish
I have a UserProfile related to auth's User model with a couple of extra date fields, start_date and end_date. I would like one and only one UserProfile that is editable inline with the parent User model in my Admin app. This part is working, but I would also like to do custom validation on the

Question regarding post_save signal

2009-03-11 Thread uno...@gmail.com
I have a post_save signal that connects to a handler (myhandler). i want to pass the user that generated the signal -- for example, say which user created a comment, which user wrote a post etc. Now I could use the foreignKey fields to the User model that are defined in my comment and post

Re: self.content_type within __unicode__ ???

2009-03-11 Thread patrickk
just for the record, this is the ticket: http://code.djangoproject.com/ticket/9362 it´s been opened 5 months ago ... On 11 Mrz., 15:07, patrickk wrote: > I´ve figured out that this seems to be a bug with edit_inline. > > patrick. > > On 11 Mrz., 13:46, patrickk

Re: self.content_type within __unicode__ ???

2009-03-11 Thread patrickk
I´ve figured out that this seems to be a bug with edit_inline. patrick. On 11 Mrz., 13:46, patrickk wrote: > when using "self.content_type" within "__unicode__" on one of my > models, I´m not getting the right ContentType. instead of getting the > reference to _another_

self.content_type within __unicode__ ???

2009-03-11 Thread patrickk
when using "self.content_type" within "__unicode__" on one of my models, I´m not getting the right ContentType. instead of getting the reference to _another_ model, I´m always getting the current model. an example: class ContainerListItem(models.Model): containerlist =

Re: Python Web dev with Django Chapter 7 is killing my desire to lean Django

2009-03-11 Thread Karen Tracey
On Wed, Mar 11, 2009 at 1:41 AM, Tokyo Dan wrote: > > Karen, you made me feel real stupid. BUT I LOVE YOU! > > I read that over and over and couldn't see it. Also I didn't know what > the heck "group name" meant. > Well, that Python exception message might could have

Re: Django 1.0.2 Final fails to install

2009-03-11 Thread Vincent
Thanks Karen. Seems like the plug-in that I use in TotalCommander to untar TGZ had an issue. Using the open-source CLI program bsdtar.exe did the trick. For those interested: http://gnuwin32.sourceforge.net/packages/libarchive.htm --~--~-~--~~~---~--~~ You

Re: Advice on project structure

2009-03-11 Thread johan . uhle
in terms of the "django poster-child" site http://www.satchmoproject.com/ might be a good start and you may also want to have a look at http://pinaxproject.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Validating interdependent inlines

2009-03-11 Thread David Gouldin
I have an admin class with a couple of inlines, and I need to validate that either one or the other has at least one instance populated. Since each inline has its own separate form in newforms admin, I'm having difficulty determining how to validate inlines that depend on each other. Any

Re: Strange behaviour with templates, dictionarys, key/value, tuple as key and nested for loop Bug?

2009-03-11 Thread johan . uhle
Of course you are right. I already changed that in my real code. This one here was just for having as simple code as possible in the mailing list post. This reminds me of this tweet: http://twitter.com/pht/status/1302494813 I always try to keep an eye on naming stuff, even if it means thinking

Re: Strange behaviour with templates, dictionarys, key/value, tuple as key and nested for loop Bug?

2009-03-11 Thread Malcolm Tredinnick
On Wed, 2009-03-11 at 02:25 -0700, johan.u...@student.hpi.uni-potsdam.de wrote: > Thanks a lot. I was just blind eyed yesterday I think. Corrected code > is: > > {% for key,value in dictionary.items %} > {{key|date:"Y-m-d"}} > {% for key,value in value.items %} >

Re: Advice on project structure

2009-03-11 Thread Malcolm Tredinnick
On Wed, 2009-03-11 at 01:01 -0700, Matt Doran wrote: > Hi Malcolm, > > On Mar 8, 4:57 pm, Malcolm Tredinnick > wrote: [...] > It seems that by making into a package, it make the django novice feel > like there is more importance to the "project" than there really >

Re: Does django support RESTful webservice and JSON encoding/decoding?

2009-03-11 Thread Malcolm Tredinnick
On Wed, 2009-03-11 at 18:40 +1100, Joshua Partogi wrote: > Dear all, > > Does django support RESTful webservice meaning that I can invoke the > Http method with RESTful URL? Yes, except the question doesn't really make sense as you've written it (you don't invoke an HTTP method). You have full

Re: garbage collection on models after use?

2009-03-11 Thread Malcolm Tredinnick
On Wed, 2009-03-11 at 08:13 +, Crispin Wellington wrote: > Hello, > > I have a surprisingly simple bit of code, injecting data into a database > via django's ORM. The "Hit" table has 1.5 million records. The problem > is, as the loop runs, more and more memory is consumed until my machine >

Post Save Signal the best plan?

2009-03-11 Thread Alfonso
Hi there, I've got a few tax calculations running on a custom save method within admin which work great but I need to build in the option to override these calculations manually. So I have 2 questions - is this what I'd use a post save method for (would I move the save calculations to a

Re: Strange behaviour with templates, dictionarys, key/value, tuple as key and nested for loop Bug?

2009-03-11 Thread johan . uhle
Thanks a lot. I was just blind eyed yesterday I think. Corrected code is: {% for key,value in dictionary.items %} {{key|date:"Y-m-d"}} {% for key,value in value.items %} {{ key.0|date:"H.i" }} - {{ key.1|date:"H.i" }} {{ value }} //

Does django support RESTful webservice and JSON encoding/decoding?

2009-03-11 Thread Joshua Partogi
Dear all, Does django support RESTful webservice meaning that I can invoke the Http method with RESTful URL? Another thing does django supports JSON encoding and decoding? Thanks in advance. -- If you can't believe in God the chances are your God is too small. Read my blog:

Re: Advice on project structure

2009-03-11 Thread Matt Doran
Hi Malcolm, On Mar 8, 4:57 pm, Malcolm Tredinnick wrote: > On Sat, 2009-03-07 at 21:29 -0800, MattDoranwrote: > > A "project" is a convenient wrapper particularly for those starting out. > > Ultimately, what you need to run a site are a settings file, a root URL > Conf