Re: post_save signal bug

2009-07-10 Thread Ryan K
I modified the above _cached_menu method to just create a new object every time (shown below). It only seems to get the links right, a ManyToMay field, after I save it _twice_? Hmmm...how I get the updated many2many table? def _cache_menu(self, menu, xhtml): """ Stores xhtml into

post_save signal bug

2009-07-10 Thread Ryan K
Hello, I am trying to implement a cache system using the post_save signal. The problem is the code below, a Thread subclass that ends up calling run(), the cache database never runs. It's driving me crazy!!! Is there something going on with the way Django cache's queries which is what I expect?

Re: Design Tools any suggestions?

2009-07-10 Thread Streamweaver
I use netbeans and there is a UML plugin that you can download and use for free. On Jul 10, 10:43 pm, dartdog wrote: > Starting to noodle out some system design stuff for Django > implementation does anyone have good ideas suggestions for useful > tools to encompass db

Re: Design Tools any suggestions?

2009-07-10 Thread Javier Guerra
dartdog wrote: > > Starting to noodle out some system design stuff for Django > implementation does anyone have good ideas suggestions for useful > tools to encompass db (model) business logic and presentation > components, flow and how to tie them together. It seems that the most > obvious

Design Tools any suggestions?

2009-07-10 Thread dartdog
Starting to noodle out some system design stuff for Django implementation does anyone have good ideas suggestions for useful tools to encompass db (model) business logic and presentation components, flow and how to tie them together. It seems that the most obvious solution in freeware is dia?

Re: duplicate primary key problem

2009-07-10 Thread adelaide_mike
Very cool, Rajesh D. Thanks. Mike On Jul 11, 12:31 am, Rajesh D wrote: > On Jul 10, 11:06 am, adelaide_mike > wrote: > > > > > I suspect this is a question more for a PostgreSQL list, but please > > bear with me. > > > In Django 1.0.2

Re: Ajax with JSON-RPC -- new Django handler

2009-07-10 Thread djfis...@gmail.com
According to the jsonrpc 1.1 working draft, the request type and response should be application/json not application/javascript. Even if you handle requests that are in other types for compatibility, you probably want your responses to be the correct type.

Is it possible to write this with Q package?

2009-07-10 Thread David
Hello, I have some records in MySQL database. Each record has id: Primary Key, autoincrement Type: varchar Price: float Date: dateTime Type can be a "car" or a "truck". There are many records whose Type is "car" or whose Type is "truck". Date has a format of "2009-07-07 20:00:00". This

Re: Automated Functional Testing

2009-07-10 Thread Kevin Teague
Yes, how many times have you followed the practice of: 1. write some new code 2. (re)start dev server and/or update dev database 3. tab over to your browser and click away 4. tab back to terminal to see the traceback when you hit an error With a functional test suite, it becomes sooo

Re: Error validating the model

2009-07-10 Thread Michael
On Fri, Jul 10, 2009 at 6:08 PM, Michael wrote: > On Fri, Jul 10, 2009 at 5:54 PM, sjtirtha wrote: > >> Hi, >> >> I have a problem calling manage.py syncdb for my models. >> Here is my models: >> from django.db import models >> from

Re: TemplateSyntaxError No such column

2009-07-10 Thread nixon66
Problem solved!!! On Jul 10, 5:41 pm, nixon66 wrote: > Getting errors when I try to render a template. Django indicates that > it is a problem in the template and tells me that there is no such > column as "aid.id". There is no column called ID in either my > template, view

Re: Error validating the model

2009-07-10 Thread Michael
On Fri, Jul 10, 2009 at 5:54 PM, sjtirtha wrote: > Hi, > > I have a problem calling manage.py syncdb for my models. > Here is my models: > from django.db import models > from django.contrib.auth.models import User > > # Create your models here. > class

Error validating the model

2009-07-10 Thread sjtirtha
Hi, I have a problem calling manage.py syncdb for my models. Here is my models: from django.db import models from django.contrib.auth.models import User # Create your models here. class DocumentType(models.Model): name = models.CharField(max_length=20, unique=True) description =

TemplateSyntaxError No such column

2009-07-10 Thread nixon66
Getting errors when I try to render a template. Django indicates that it is a problem in the template and tells me that there is no such column as "aid.id". There is no column called ID in either my template, view or model. Any suggestions. I've included the error, template, my view and model

Queries for Related Objects wonky

2009-07-10 Thread Streamweaver
I'm using Django 1.0.2 and having some problems with Related Object queries. For example I have a model called Project with a ForeignKey to a Django User. class Project(models.Model): ... owner = models.ForeignKey(User) ... by the documentation I would expect the following to give me

Re: parsing urls with dot

2009-07-10 Thread Aaron Maxwell
On Thursday 09 July 2009 05:47:48 am Dids wrote: > > Why not to add dots to your regexp? For example, [\w\d\-\.]+ ? > > I guess my question should have been: How come \. doesn't appear to be > matched in url.py? > That's the problem, it doesn't work. It should. Are you using raw strings? Post

Re: Manipulating post data before sending?

2009-07-10 Thread killsto
Thanks, that worked. On Jul 10, 1:44 pm, Jonathan Buchanan wrote: > > I'm making a small app which is kind of like a blog. I have an Entry > > class which has "ForeignKey(User)" as one of its members. I'm using > > ModelForm to generate the form and I'm excluding

Re: Reading data from database tied to another Django project?

2009-07-10 Thread Ian Clelland
On Jul 10, 12:37 pm, Ben Kreeger wrote: > How do I go about accessing that data from P2's database? Do I need to > create a model in P1 and bind it to a certain table in P2's database? > If that's the case, how do I specify access credentials for that > database? Is

Creating a model and related models with Inline formsets

2009-07-10 Thread chefsmart
Hi, Using the example at http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#inline-formsets , I am able to _edit_ objects belonging a particular model (using modelforms). I have been trying to follow the same pattern for _creating_ new objects using inline formsets, but have been

Reading data from database tied to another Django project?

2009-07-10 Thread Ben Kreeger
Here's the situation: I've got two projects, both Django. One is a simple, public-facing website that renders a library of reStructuredText files, as well as a couple of simple forms using the Forms API. The other is a back-end that requires a login from a member of our staff, and contains

Re: Manipulating post data before sending?

2009-07-10 Thread Jonathan Buchanan
> I'm making a small app which is kind of like a blog. I have an Entry > class which has "ForeignKey(User)" as one of its members. I'm using > ModelForm to generate the form and I'm excluding the User ForeignKey > because it will just ask for you to pick a user from a drop-down > list. > > Where

Manipulating post data before sending?

2009-07-10 Thread killsto
I'm making a small app which is kind of like a blog. I have an Entry class which has "ForeignKey(User)" as one of its members. I'm using ModelForm to generate the form and I'm excluding the User ForeignKey because it will just ask for you to pick a user from a drop-down list. Where do I tell it

Re: Ajax with JSON-RPC -- new Django handler

2009-07-10 Thread BenW
I fixed the above problem with URL reversing by refactoring the JSONRPCService.__call__ method to grab it from the request object. def __call__(self, request, extra=None): if request.method == "POST": return HttpResponse(self.process(request),

Re: Multiple Sites with minimal configuration

2009-07-10 Thread Michel Thadeu Sabchuk
Hi Adam, > I'm presuming I will use the sites app.  However, I don't see how I > can create and set the SITE_ID through the admin (which is necessary > for number 2). > > Would people suggest that I use the RequestSite class from the sites > app which uses the HttpRequest variables?  If so, does

sessions and multiple login as same user

2009-07-10 Thread adrian
My app is used in an office with multiple users logged in and using it simultaneously. Sometimes they may log in as the same user. Is there any reason this should cause interaction between their sessions? I have looked through the session code and see nothing that should prevent these from

Re: duplicate primary key problem

2009-07-10 Thread Rajesh D
On Jul 10, 11:06 am, adelaide_mike wrote: > I suspect this is a question more for a PostgreSQL list, but please > bear with me. > > In Django 1.0.2 working with PostgreSQL 8.3 I have a model with an > implied pkey.  PostgreSQL syas this: > > CREATE TABLE

Re: ImportError: No module named urls

2009-07-10 Thread Russell Keith-Magee
On Fri, Jul 10, 2009 at 10:33 PM, huw_at1 wrote: > > So I switched from mod_python to mod_wsgi since I don;t really know > what is going on and I realise mod_wsgi is recommended for 1.1 now. > Anyway the rest of my site works fine now. The only part still not > working is the

Re: NameError: name 'Job' is not defined

2009-07-10 Thread Rajesh D
On Jul 10, 8:39 am, bruno wrote: > Hi, > > I'm new in django and I have problem with importing models > > I have two class : Job and Event > > The Job class defines a method run_job() wich do something and log the > result by creating a new Event so I need to import

duplicate primary key problem

2009-07-10 Thread adelaide_mike
I suspect this is a question more for a PostgreSQL list, but please bear with me. In Django 1.0.2 working with PostgreSQL 8.3 I have a model with an implied pkey. PostgreSQL syas this: CREATE TABLE wha_property ( id serial NOT NULL, propnum character varying(16) NOT NULL, beds integer,

Multiple Sites with minimal configuration

2009-07-10 Thread Adam Nelson
I'm creating a new project with pretty simple requirements: 1. A core set of methods for validating data which I will build. 2. The ability for a person with minimal skills to drop HTML form pages (2 or 3) for a given hostname (www.example1.com, www.example2.com, www.example3.com) that accept

Re: Report Failures when running Django's unit tests?

2009-07-10 Thread Karen Tracey
On Fri, Jul 10, 2009 at 10:41 AM, Eric Brian wrote: > > Ok, so I finally got Django's unit tests to run and when I did, there > was one failure. I checked the FAQ to see if this should be reported > or not. There was no mention, so I wonder, should I report any test > that

Report Failures when running Django's unit tests?

2009-07-10 Thread Eric Brian
Ok, so I finally got Django's unit tests to run and when I did, there was one failure. I checked the FAQ to see if this should be reported or not. There was no mention, so I wonder, should I report any test that doesn't pass? --~--~-~--~~~---~--~~ You received

Re: ImportError: No module named urls

2009-07-10 Thread huw_at1
So I switched from mod_python to mod_wsgi since I don;t really know what is going on and I realise mod_wsgi is recommended for 1.1 now. Anyway the rest of my site works fine now. The only part still not working is the admin section which fails with this "No module named urls" error as can be seen

attrs for all choices in choicefield

2009-07-10 Thread virhilo
Hi I have that choice field: RATES = ( ('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ) rating = forms.ChoiceField(widget=forms.RadioSelect(), required=True, choices=RATES) Now - how to assign attrs for all choices(for example apply css

Re: NameError: name 'Job' is not defined

2009-07-10 Thread Ramiro Morales
On Fri, Jul 10, 2009 at 9:39 AM, bruno wrote: > > Hi, > > I'm new in django and I have problem with importing models > > I have two class : Job and Event > > The Job class defines a method run_job() wich do something and log the > result by creating a new Event so I need

NameError: name 'Job' is not defined

2009-07-10 Thread bruno
Hi, I'm new in django and I have problem with importing models I have two class : Job and Event The Job class defines a method run_job() wich do something and log the result by creating a new Event so I need to import the Event class from file app/events/models.py The Event class reference the

Adding a custom field to an admin model (table)

2009-07-10 Thread haestan none
Hi, I would like to add a custom field to an existing admin model, namely LogEntry. The goal is to add a comment field, where custom change comments can be added in the admin whenever a model is saved. Is it even possible to add such a field without changing the existing admin codebase? Or

Re: more formset adventures

2009-07-10 Thread Karen Tracey
On Fri, Jul 10, 2009 at 7:30 AM, Michael Stevens wrote: > > Hi. > > I'm using a ModelFormset created with lineformset_factory. > > When I click delete on one of the records and save the formset, it > successfully removes the associated db record, but if I redisplay the >

Running the site

2009-07-10 Thread kannan4k
Hi Friends... I am new to Django.I Just learning the django now. http://in.pycon.org/2009/ . That website uses django and the code is here - http://bitbucket.org/lawgon/fossconf/downloads/ In this Source code I din't find the models.py to run the Local Server.In what way can i run this

more formset adventures

2009-07-10 Thread Michael Stevens
Hi. I'm using a ModelFormset created with lineformset_factory. When I click delete on one of the records and save the formset, it successfully removes the associated db record, but if I redisplay the formset after the save, it's still showing the now removed form. I've modified my code to

Re: How to execute more code after sending an HTTP response in a viewfunction?

2009-07-10 Thread Tom Evans
On Thu, 2009-07-09 at 13:19 -0700, Fluoborate wrote: > Hello All, > > I am afraid that I might have to write my own middleware to do this. I > really want to do something like the following: > > #In views.py: > > def welcome( request ): > return HttpResponse( "Welcome to my website" ) >

Re: How to execute more code after sending an HTTP response in a viewfunction?

2009-07-10 Thread Rodrigue
Kicking off threads could be a solution, if you want your time- consuming_function to run in the same process(es) as django. Otherwise, you'll need to either create new processes or use some inter process communication solution (socket, http, message queue, ...) In the first situation, make sure

Re: problems with model formsets

2009-07-10 Thread Michael Stevens
I worked it out in the end - I had two formsets in the same form, and hadn't realised the need for the prefix option to separate them. 2009/7/10 Karen Tracey : > On Thu, Jul 9, 2009 at 12:01 PM, Michael Stevens > wrote: >> >> Hi. >> >> I'm trying to

Re: Some post_related_objects_save signal or workaround?

2009-07-10 Thread Eugene Mirotin
Thanks for your reply, Ryan, but it would be equivalent to simply calling the self.parent.some_method() from the round save. And my purpose is to have the signal (or other way of tracking) for the point when _all_ objects (rounds) related to the specific object (game) are saved. Something like