Django forms and relationships

2009-03-16 Thread tdelam
Hi, I am using the User model and trying to store additional information about the person registering. I have a model called UserProfile with a few additional fields and a FK to the User model. I now have a forms.py for my forms which consists of: http://dpaste.com/hold/15470/ My question is

Re: Sending attachments with django-contact-form

2009-03-16 Thread John Hensley
On Mar 16, 2009, at 3:46 PM, Dana wrote: > I am wondering what the simplest way to send an attachment with > django- > contact-form (http://code.google.com/p/django-contact-form/) is. [...] > Im interested in just a simple example of sending a file along with > the other email information. I

Re: best way to organize models that store businesses/hours?

2009-03-16 Thread Alex Gaynor
On Mon, Mar 16, 2009 at 11:26 PM, luxagraf wrote: > > Hello all- > > I'm working of a site that will store various business listings > (restaurants, bars, clubs etc) and then I'd like to also track the > hours each business is open... The ultimate goal being something like >

best way to organize models that store businesses/hours?

2009-03-16 Thread luxagraf
Hello all- I'm working of a site that will store various business listings (restaurants, bars, clubs etc) and then I'd like to also track the hours each business is open... The ultimate goal being something like lawrence.com's "open now" feature and other time-related queries of that type. I'm

Re: Aggregation Questions

2009-03-16 Thread koranthala
On Mar 16, 11:44 pm, Alex Gaynor wrote: > On Mon, Mar 16, 2009 at 11:52 AM, koranthala wrote: > > > On Mar 16, 8:14 pm, Alex Gaynor wrote: > > > On Mon, Mar 16, 2009 at 11:07 AM, koranthala > > wrote:

Re: schema to model

2009-03-16 Thread hc w
Thank you. Alex  --- 09年3月17日,周二, Alex Gaynor 写道: 发件人: Alex Gaynor 主题: Re: schema to model 收件人: django-users@googlegroups.com 日期: 2009年3月17日,周二,上午10:54 On Mon, Mar 16, 2009 at 10:42 PM, skysoaring1 wrote: Hi,All,

Re: schema to model

2009-03-16 Thread Alex Gaynor
On Mon, Mar 16, 2009 at 10:42 PM, skysoaring1 wrote: > > Hi,All, > > We plan to develop an application on an existing database with Django. > So is there any tool to generate model class from schema like such > tools with hibernate? Thanks a lot! > > Regards > > /sky >

schema to model

2009-03-16 Thread skysoaring1
Hi,All, We plan to develop an application on an existing database with Django. So is there any tool to generate model class from schema like such tools with hibernate? Thanks a lot! Regards /sky --~--~-~--~~~---~--~~ You received this message because you are

Re: Django bug that should be addressed: Idle timeouts do not clear session information

2009-03-16 Thread Huuuze
Care to elaborate with some sample code? On Mar 16, 9:12 pm, Paulo Köch wrote: > A background sleeper (as opposed to worker) that would fire a signal > upon timer expiration seems like a nice mechanism. > > Cheers, > Paulo Köch > > On Tue, Mar 17, 2009 at 01:04, Jeff FW

Re: override render_to_response

2009-03-16 Thread Malcolm Tredinnick
On Mon, 2009-03-16 at 18:34 -0700, Preston Timmons wrote: > I am wondering if render_to_response is really the proper function you > are looking for. > > For instance, here is a simple view that returns json using > HttpResponse without need of a template: He was wanting to hijack the output

Re: override render_to_response

2009-03-16 Thread Preston Timmons
I am wondering if render_to_response is really the proper function you are looking for. For instance, here is a simple view that returns json using HttpResponse without need of a template: import simplejson from django.http import HttpResponse def output_json(request): data = [

Re: Saving model with raw=True

2009-03-16 Thread Preston Timmons
Thanks, Alex, I must misunderstand what it is for then. I got the idea from a post where Russ Magee mentioned it as being a way to prevent auto_now fields from being executed:

Re: Django bug that should be addressed: Idle timeouts do not clear session information

2009-03-16 Thread Paulo Köch
And it's clearly a feature request. Bug implies defect in implementation, not formulation. Cheers. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Django bug that should be addressed: Idle timeouts do not clear session information

2009-03-16 Thread Paulo Köch
A background sleeper (as opposed to worker) that would fire a signal upon timer expiration seems like a nice mechanism. Cheers, Paulo Köch On Tue, Mar 17, 2009 at 01:04, Jeff FW wrote: > > When you say "audit"--what do you mean?  By that, I mean, what do you > plan to do

Re: Django bug that should be addressed: Idle timeouts do not clear session information

2009-03-16 Thread Jeff FW
When you say "audit"--what do you mean? By that, I mean, what do you plan to do with the data? Do you need to know the second someone times out, or can you check later? If you need to know immediately, I think you may need to do something terrible with JavaScript. If not, or you can at least

Re: Django bug that should be addressed: Idle timeouts do not clear session information

2009-03-16 Thread Alex Gaynor
On Mon, Mar 16, 2009 at 8:56 PM, Huuuze wrote: > > Jeff (and Jacob)... > > I appreciate your responses and I stand corrected. With that being > said, are either of you (or anyone reading this) aware of a method > that would allow me to track idle session timeouts? I'd like to

Re: Django bug that should be addressed: Idle timeouts do not clear session information

2009-03-16 Thread Huuuze
Jeff (and Jacob)... I appreciate your responses and I stand corrected. With that being said, are either of you (or anyone reading this) aware of a method that would allow me to track idle session timeouts? I'd like to audit when a user has been logged out due to a timeout. Huuuze On Mar 16,

Creating objects with references

2009-03-16 Thread nivhab
hi, I need to create 2 objects, one containing a reference to the other, in one shot. I get an IntegrityError exception while trying to do so, claiming that the foreign key is None on creation. Hope someone can help... (when I refresh the browser and rePOST the data it works as the Product

Re: Django bug that should be addressed: Idle timeouts do not clear session information

2009-03-16 Thread Jeff FW
It's not a bug. When a cookie expires, the browser stops sending it with its requests--therefore, there is *no* way for Django to know that the cookie (and therefore, the session) has expired. There is no "timeout" happening on the server side, so the session can't get cleared out. Hence, why

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

2009-03-16 Thread Scott Lyons
Based on mrts' drawings, I made two backgrounds. I'm open to suggestions or requests. http://www.flickr.com/photos/damagedgenius/3361587194/ and http://www.flickr.com/photos/damagedgenius/3361587300/in/photostream/ On Mar 16, 6:27 pm, bruno desthuilliers wrote:

Re: override render_to_response

2009-03-16 Thread Malcolm Tredinnick
On Mon, 2009-03-16 at 20:05 -0400, Malinka Rellikwodahs wrote: [...] > Unless I'm mistaken it should be fairly simple in this case to create > your own set of templates for each of the django apps you're using and > then have them output the data you need as json text instead of as > html Ooh

Re: override render_to_response

2009-03-16 Thread Malinka Rellikwodahs
On Mon, Mar 16, 2009 at 12:42, a b wrote: > Hi, > > I'm building a one page app with no page refresh. > All the content is loaded as JSON dynamically and the UI is built using > javascript. > > I'm using external django apps and I need them to send back the context dict >

Re: How do I determine when a user has an idle timeout in Django?

2009-03-16 Thread Malcolm Tredinnick
On Mon, 2009-03-16 at 12:36 -0700, Huuuze wrote: > I would like to audit when a user has experienced an idle timeout in > my Django application. In other words, if the user's session cookie's > expiration date exceeds the SESSION_COOKIE_AGE found in settings.py, > the user is redirected to the

Re: override render_to_response

2009-03-16 Thread Malcolm Tredinnick
On Mon, 2009-03-16 at 18:42 +0200, a b wrote: > Hi, > > I'm building a one page app with no page refresh. > All the content is loaded as JSON dynamically and the UI is built > using javascript. > > I'm using external django apps and I need them to send back the > context dict as JSON instead >

Re: Lookup across relations

2009-03-16 Thread Malcolm Tredinnick
On Mon, 2009-03-16 at 17:29 +0100, Matías Costa wrote: [...] > > BTW, this is Django 1.0, I had to rename your maxlength field > parameter to max_length. Are you using 0.96? Oh, dear. If the original poster is using 0.96, then this has little chance of working. Complex queries involving

Re: Many to Many is empty when saving parent object

2009-03-16 Thread Malcolm Tredinnick
On Mon, 2009-03-16 at 08:48 -0700, Brandon Taylor wrote: > Hi everyone, > > I'm running Python 2.6.1, Django Trunk. > > I have a model (Entry) with a ManyToMany (Categories). I need to be > able to iterate over these categories whenever my parent model is > saved. > > I've tried overriding

Re: How to say Hello "Somebody" in a Django form. Displaying data context values as non-input.

2009-03-16 Thread Brian Neal
On Mar 16, 2:14 pm, NoviceSortOf wrote: > > So perhaps a better question would be is > > in view.py... > --- > thisusername = str(request.user.username) > data = {'thisusername':username,} > form = form_class(data) > > Why is it form_class(data) does not accept

Re: multiple python versions

2009-03-16 Thread Malcolm Tredinnick
On Mon, 2009-03-16 at 08:43 -0700, TheIvIaxx wrote: > Hello, on my dev machine I am running a django instance on its little > dev server with python 2.5.2 32bit. Works fine. But all of our tool > are written for python 2.5.x 64bit. These are irrelevant to django. > > Having both python

Re: legacy oracle database -w- existing schema

2009-03-16 Thread bruce
Yes, this resolve the issue. Thank you! On Mar 16, 2:29 pm, "Mad Sweeney" wrote: > - Original Message - > From: "bruce" > To: "Django users" > Sent: Monday, March 16, 2009 9:00 PM > Subject: legacy oracle

Re: Verbose Error Logging

2009-03-16 Thread Malcolm Tredinnick
On Mon, 2009-03-16 at 07:27 -0700, PB wrote: > Hi, > > Is there any way to force tracebacks that are normally swallowed by > the templating engine to be logged to the server's error logs? > It's not possible to tell which errors are intended to be caught and which aren't. Many AttributeError

Re: Overriding the HTML id in ModelForm

2009-03-16 Thread Romain
Thanks a lot for the great answers, and the information about the form prefix (it is what I was looking for)! Sorry, I missed the replies 1 week ago :( Thanks again, Romain On Mar 6, 1:42 am, Eric Abrahamsen wrote: > On Mar 5, 2009, at 11:14 AM, Alex Gaynor wrote: > > > > >

Re: PositiveIntegerField returning a string?

2009-03-16 Thread Malcolm Tredinnick
On Mon, 2009-03-16 at 07:06 -0700, msoulier wrote: [...] > The code populating it looks like this > >metrics.user_licenses_ca = int( > details.get('Max_users', '0/0/0').split('/')[2]) > > The Max_users field contains a '/' delimited sting of three numbers, > which is why I'm

Re: How to say Hello "Somebody" in a Django form. Displaying data context values as non-input.

2009-03-16 Thread Briel
First of all what you have written will most likely give syntax error, in your dict you have reversed the key and value. You probably want it to look like this: {"username": thisusername}. But you can't just throw random data at forms and hope for it to work. There are some different solutions,

Re: Saving model with raw=True

2009-03-16 Thread Alex Gaynor
On Mon, Mar 16, 2009 at 6:55 PM, Preston Timmons wrote: > > At one time it seems there was an intention to have the save method on > models accept a keyword argument named raw which would allowed the > model to be saved without pre-processing. This argument is available

Saving model with raw=True

2009-03-16 Thread Preston Timmons
At one time it seems there was an intention to have the save method on models accept a keyword argument named raw which would allowed the model to be saved without pre-processing. This argument is available in the save_base method but not available in the save method. Am I right to conclude that

Re: Django bug that should be addressed: Idle timeouts do not clear session information

2009-03-16 Thread Jacob Kaplan-Moss
On Mon, Mar 16, 2009 at 4:46 PM, Huuuze wrote: > Does anyone else agree with my viewpoints on this matter?  If so, > please post your comments in the ticket. Actually, the right way to get your viewpoint heard is to take the matter to the django-developers mailing list, where

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

2009-03-16 Thread bruno desthuilliers
On 11 mar, 19:10, Eric Walstad wrote: > 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

Re: Switching database backends at runtime?

2009-03-16 Thread Alex Gaynor
On Mon, Mar 16, 2009 at 6:20 PM, Oliver Beattie wrote: > > Does anyone know if it's possible to switch the database backend in > Django at runtime (let's say I want to use dummy for something, but > then switch it back to the original after I'm done). > > Is this possible

Switching database backends at runtime?

2009-03-16 Thread Oliver Beattie
Does anyone know if it's possible to switch the database backend in Django at runtime (let's say I want to use dummy for something, but then switch it back to the original after I'm done). Is this possible using django.db.load_backend or something (I'm doubting it as I see there is some

Django bug that should be addressed: Idle timeouts do not clear session information

2009-03-16 Thread Huuuze
I opened the following ticket which was unceremoniously closed by a committer: http://code.djangoproject.com/ticket/10518 Here is the text from the ticket: >> I have set the SESSION_COOKIE_AGE value in my settings.py file to expire >> sessions after 1 hour. Django successfully logs the user

Re: legacy oracle database -w- existing schema

2009-03-16 Thread bruce
I can look into that as an option. I don't have access to administrate this database. On Mar 16, 2:29 pm, "Mad Sweeney" wrote: > - Original Message - > From: "bruce" > To: "Django users" > Sent: Monday, March

Re: legacy oracle database -w- existing schema

2009-03-16 Thread Mad Sweeney
- Original Message - From: "bruce" To: "Django users" Sent: Monday, March 16, 2009 9:00 PM Subject: legacy oracle database -w- existing schema > > Hi- > I'm a new user to Django. I've searched through the documentation and > other

legacy oracle database -w- existing schema

2009-03-16 Thread bruce
Hi- I'm a new user to Django. I've searched through the documentation and other posted questions. I'm currently attempting to setup the model to access an Oracle 9 database. I have access the database, yet the tables and views are stored in another existing schema not owned by me. Other than

Re: get_absolute_url not working on deployed site; exact same code works on dev site

2009-03-16 Thread Theme Park Photo, LLC
I have a feeling this is related (but I'm still stuck!) Occasionally, when I start it up, I see this: The URLCONF in settings.py looks OK File "/usr/lib/python2.4/site-packages/django/core/urlresolvers.py", line 198, in _get_urlconf_module self._urlconf_module =

Sending attachments with django-contact-form

2009-03-16 Thread Dana
Hello, I am wondering what the simplest way to send an attachment with django- contact-form (http://code.google.com/p/django-contact-form/) is. I don't have much experience with sending emails with Python, so Im a bit lost. I tried overriding the save method but couldn't get it functioning. Im

django-registration - Unhandled Exception

2009-03-16 Thread neri...@gmail.com
Hello, I successfully set up django-registration on my local machine to the point of being able to load a url and attempt to load the template. However, I'm trying to set it up on Dreamhost and keep getting "An unhandled exception was thrown by the application." The only thing I had to do

How do I determine when a user has an idle timeout in Django?

2009-03-16 Thread Huuuze
I would like to audit when a user has experienced an idle timeout in my Django application. In other words, if the user's session cookie's expiration date exceeds the SESSION_COOKIE_AGE found in settings.py, the user is redirected to the login page. When that occurs, an audit should also occur.

Re: How to say Hello "Somebody" in a Django form. Displaying data context values as non-input.

2009-03-16 Thread Danny Brown
thisusername = str(request.user.username) data = {'thisusername':username,} form = form_class(data) shouldn't this be data={'thisusername':thisusername,} or {'thisusername': str(request.user.username)} On Mon, Mar 16, 2009 at 2:14 PM, NoviceSortOf wrote: > > Thanks

Re: How to say Hello "Somebody" in a Django form. Displaying data context values as non-input.

2009-03-16 Thread NoviceSortOf
Thanks for your responses, they have helped. I've read the documentation many times, and only resort to groups after re-reading what I can find in the docs, testing various logical solutions, digging through groups and finally confering with a 3rd party book I've here on Django. If all else

get_absolute_url not working on deployed site; exact same code works on dev site

2009-03-16 Thread Theme Park Photo, LLC
I'm having problems with get_absolute_url not working. It works fine on my development site, but when I tried to deploy it, it fails, and I can't figure out why I'm using the "basic.blog" app >>> post = Post.objects.published() >>> p = post[0] >>> print p.get_absolute_url() Traceback (most

Re: Aggregation Questions

2009-03-16 Thread Alex Gaynor
On Mon, Mar 16, 2009 at 11:52 AM, koranthala wrote: > > > > On Mar 16, 8:14 pm, Alex Gaynor wrote: > > On Mon, Mar 16, 2009 at 11:07 AM, koranthala > wrote: > > > > > Hi, > > >I downloaded Django 1.1 due to aggregation

Re: How to say Hello "Somebody" in a Django form. Displaying data context values as non-input.

2009-03-16 Thread johan . uhle
> How does Django enable the ability to pass variables to a Form or a > Template whose purpose is only to be displayed? Given that the input has been validated correctly and does not throw an error you can access the value with form.cleaned_data.username If you want to pass a variable to a

Re: Port in use Error

2009-03-16 Thread Daniel Roseman
On Mar 16, 5:16 pm, TP wrote: > Unfortunately the website doesnt work, just get  a blank web page. > > Im working from a University computer so im guessing it may be due to > that problem as I have no other programs running apart from Firefox > So use a different port

Re: How to say Hello "Somebody" in a Django form. Displaying data context values as non-input.

2009-03-16 Thread Daniel Roseman
On Mar 16, 5:15 pm, NoviceSortOf wrote: > I just want to say Hello Mary in my HTML code pulling Mary's username > from the request.data. > > I've dug through the documentation and through this group, but am > still baffled by > what seems the inability of Django to allow

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

2009-03-16 Thread Klowner
That's just awesome. Quick and dirty 3D version done in blender :) http://img.skitch.com/20090316-82bsdnfjm15xarx3t9c1e4a7q9.png - Mark On Mar 11, 1:10 pm, Eric Walstad <ewals...@gmail.com> wrote: > It occurred to me that my 9yr old daughter has been listening to me > talk

Re: Port in use Error

2009-03-16 Thread TP
Unfortunately the website doesnt work, just get a blank web page. Im working from a University computer so im guessing it may be due to that problem as I have no other programs running apart from Firefox On Mar 16, 5:13 pm, Dougal Matthews wrote: > It means another program

How to say Hello "Somebody" in a Django form. Displaying data context values as non-input.

2009-03-16 Thread NoviceSortOf
I just want to say Hello Mary in my HTML code pulling Mary's username from the request.data. I've dug through the documentation and through this group, but am still baffled by what seems the inability of Django to allow someone to display a value in some format other than an input variable of a

How to say Hello "Somebody" in a Django form. Displaying data context values as non-input.

2009-03-16 Thread NoviceSortOf
I just want to say Hello Mary in my HTML code pulling Mary's username from the request.data. I've dug through the documentation and through this group, but am still baffled by what seems the inability of Django to allow someone to display a value in some format other than an input variable of a

Re: Port in use Error

2009-03-16 Thread Dougal Matthews
It means another program is using the port you are trying to use. Do you have another server running? or skype by any chance? If you can still view the website in the browser, its not a problem. If you can't you should use another port or close the program using the same port. Dougal --- Dougal

Port in use Error

2009-03-16 Thread TP
After creating a new project, when running manage.py i get the following: Validating models... 0 errors found Django version 1.0.2 final, using settings 'mylu.settings' Development server is running at http://127.0.0.1:8000/ Quit the server with CONTROL-C. Error: That port is already in use.

Re: Strip empty lines in rendered templates?

2009-03-16 Thread Benjamin Buch
Yes, you're right. But as the SpacelessMiddleware uses djangos' strip_spaces_between_tags, which strips all whitespace between tags and not just empty lines, I think it would have been fiddly to adapt it without touching django internals. In this case it seemed easier for me to use

override render_to_response

2009-03-16 Thread a b
Hi, I'm building a one page app with no page refresh. All the content is loaded as JSON dynamically and the UI is built using javascript. I'm using external django apps and I need them to send back the context dict as JSON instead of rendering the html template. Is it possible to override

Re: Strip empty lines in rendered templates?

2009-03-16 Thread Dougal Matthews
You could adapt that middlewear to make it only stop blank lines I'm sure. I use it for one website and its only used in the production version, in my settings for the dev version it doesn't include that middlewear so it doesn't effect any front end development. Only thing to be aware of is it

Strategy for extending DB tables with additional columns

2009-03-16 Thread Trey
Hello everyone, I am hoping someone has some experience in this already. I have a rough idea of how to do it, but I am hoping to discover a better way. What I have: A contact manager. A contact has a set of data that makes sense on anyone's version of a contact, things like name, email address,

Re: Lookup across relations

2009-03-16 Thread Matías Costa
2009/3/16 Matías Costa > On Sun, Mar 15, 2009 at 2:54 PM, 3xM <3...@detfalskested.dk> wrote: > >> >> Gees... It messed with my link. I'll try again: >> http://blackfin.cannedtuna.org/django-testcase.tar.gz >> >> >> > It works OK here. I have added __rerpr__ method to

Re: Aggregation Questions

2009-03-16 Thread koranthala
On Mar 16, 8:14 pm, Alex Gaynor wrote: > On Mon, Mar 16, 2009 at 11:07 AM, koranthala wrote: > > > Hi, > >    I downloaded Django 1.1 due to aggregation support. > >    But I am facing one issue which I cannot seem to overcome. > >    I have two

Re: Strip empty lines in rendered templates?

2009-03-16 Thread Benjamin Buch
Thank you for your replies! What I essentially want to do is: 1: Keep the template output readable for the frontend coder I'm working with 2: Keep the templates readable for me. @Dougal: I think the solution you suggested is great when someone wants to keep the size of the rendered template

Many to Many is empty when saving parent object

2009-03-16 Thread Brandon Taylor
Hi everyone, I'm running Python 2.6.1, Django Trunk. I have a model (Entry) with a ManyToMany (Categories). I need to be able to iterate over these categories whenever my parent model is saved. I've tried overriding save_model in the admin, and adding a post_save signal to Entry in order to be

multiple python versions

2009-03-16 Thread TheIvIaxx
Hello, on my dev machine I am running a django instance on its little dev server with python 2.5.2 32bit. Works fine. But all of our tool are written for python 2.5.x 64bit. These are irrelevant to django. Having both python versions installed causes and issue with django. How do I tell

Re: ImproperlyConfigured: MySQLdb-1.2.1p2 or newer is required; you have 1.2.1 But I HAVE 1.2.2!

2009-03-16 Thread Theme Park Photo, LLC
Thanks, Malcolm! The problem was an old django. I was setting up a new machine, and I didn't realize that easy_install put an old django on my machine. When I downloaded the latest 1.0.2 trunk and installed it, the problem went away On Mar 15, 9:12 pm, Malcolm Tredinnick

Re: Simple sites framework question

2009-03-16 Thread Baxter
D'oh. I knew I was missing something simple and obvious. Thanks. --~--~-~--~~~---~--~~ 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

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

2009-03-16 Thread Jesse
Hello Paul, Thanks!! I'll try it. On Mar 13, 2:21 pm, pkenjora wrote: > Uhm maybe this post will help its a tag that handles thepaginationon > query objects.  I've used it in a few of my projects and > its quite handy. > > http://blog.awarelabs.com/?p=29 > > -Paul > >

Re: Simple sites framework question

2009-03-16 Thread Alex Gaynor
On Mon, Mar 16, 2009 at 11:19 AM, bax...@gretschpages.com < mail.bax...@gmail.com> wrote: > > In my model, I've got > >sites = models.ManyToManyField(Site) > > In a signal, I want to check which site(s) that model has been > assigned to, not which site their currently on. I need something

Re: Simple sites framework question

2009-03-16 Thread Dougal Matthews
I think these are the relevant docs you need; http://docs.djangoproject.com/en/dev/topics/db/queries/#related-objects Dougal --- Dougal Matthews - @d0ugal http://www.dougalmatthews.com/ 2009/3/16 bax...@gretschpages.com > > In my model, I've got > >sites =

Simple sites framework question

2009-03-16 Thread bax...@gretschpages.com
In my model, I've got sites = models.ManyToManyField(Site) In a signal, I want to check which site(s) that model has been assigned to, not which site their currently on. I need something like if instance.sites.id == 1: do stuff Of course, that doesn't work. How do I do this?

Re: Aggregation Questions

2009-03-16 Thread Alex Gaynor
On Mon, Mar 16, 2009 at 11:07 AM, koranthala wrote: > > Hi, >I downloaded Django 1.1 due to aggregation support. >But I am facing one issue which I cannot seem to overcome. >I have two fields which represents two different times. >I want to get the sum of

Aggregation Questions

2009-03-16 Thread koranthala
Hi, I downloaded Django 1.1 due to aggregation support. But I am facing one issue which I cannot seem to overcome. I have two fields which represents two different times. I want to get the sum of difference of times - and I am unable to do so. Basically, I want to do as follows:

on delete set null

2009-03-16 Thread Thomas Guettler
Hi, I have a foreign key from MyModel to contrib.auth.models.User which can be null. Unfortunately if you delete the user, the MyModel instance gets deleted, too. I found an open ticket[1], but nevertheless don't know how to get the "on delete set null" done. One solution would be this:

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

2009-03-16 Thread mrts
On Mar 16, 3:53 pm, Torsten Bronger wrote > No, I mean "contained in the original critter".  As far as I can > see, you added the glory.  I simply wonder why. Ah, sorry for the misunderstanding :). It looked nice, conveys the "helpful fellow" message and -- last

Verbose Error Logging

2009-03-16 Thread PB
Hi, Is there any way to force tracebacks that are normally swallowed by the templating engine to be logged to the server's error logs? Much of the time the superb error handling in the template engine means that little bugs can often fly under the radar. Additionally, when a site is deployed,

Re: Snap and SCT - any reviews?

2009-03-16 Thread John Crawford
Sorry, I wasn't trying to be rude or take anyone for granted. I noticed that the post had dropped back several pages on the forum, and just wanted to to bump it up, which I guess isn't a good idea. And the line is from "Ferris Bueller's Day Off', which I thought would be funny :) Sorry again.

beginner model question - two tables without foreign keys (myslq - myisam)

2009-03-16 Thread Norman
How to perform such simple query: select p.text, b.title from books b, phrase p where p.book_id = b.id on tables books{ id : int, title: varchar } phrase{ id : int, book_id : int, text: varchar } but using django models? --~--~-~--~~~---~--~~ You received

Re: PositiveIntegerField returning a string?

2009-03-16 Thread msoulier
On Mar 14, 1:35 am, Russell Keith-Magee wrote: > It's possible that this is a known bug that has been fixed since v0.96 > was released. Where exactly did metrics object come from? Is is a > newly created object, or was it obtained as the result of a query? It was created

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

2009-03-16 Thread Torsten Bronger
Hallöchen! mrts writes: > On Mar 16, 2:55 pm, Torsten Bronger > wrote: > >> mrts writes: >> >>> On Mar 15, 5:56 pm, mrts wrote: >> I don't, therefore I'm all for the critter and my (styled) take is here:http://mrts-foo.appspot.com/ >>

Starting custom settings with django-admin.py failed

2009-03-16 Thread Joshua Partogi
Dear all, I have a custom setting which I would like to run with django-admin as such: django-admin.py runserver --settings=portal.settings The name of my project is 'portal' and in my project directory there's already __init__.py so I assume that python will already recognize this as a python

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

2009-03-16 Thread mrts
On Mar 16, 2:55 pm, Torsten Bronger wrote: > Hallöchen! > > mrts writes: > > On Mar 15, 5:56 pm, mrts wrote: > > >> I don't, therefore I'm all for the critter and my (styled) take > >> is here:http://mrts-foo.appspot.com/ > > > For anyone still

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

2009-03-16 Thread Geobase Isoscale
Encouraging to new guys in the block, there hope of longevity here...no more hop and jump to other languages. On Mon, Mar 16, 2009 at 1:32 PM, mrts wrote: > > On Mar 15, 5:56 pm, mrts wrote: > > I don't, therefore I'm all for the critter and my (styled) take

Re: Conditional row coloring in django-admin changelist

2009-03-16 Thread Blake M. Sisco
one thing that i should point out is that the column is "prettified" so it uses the "on" image instead of the value of the db field. don't know if this makes a difference or not cuz the value is the img alt. Blake M. Sisco LOR Manufacturing Co., Inc Web Presence • Graphic Design www.lormfg.com

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

2009-03-16 Thread Torsten Bronger
Hallöchen! mrts writes: > On Mar 15, 5:56 pm, mrts wrote: > >> I don't, therefore I'm all for the critter and my (styled) take >> is here:http://mrts-foo.appspot.com/ > > For anyone still interested in the critter, there are some banners > now at http://mrts-foo.appspot.com/

Re: Conditional row coloring in django-admin changelist

2009-03-16 Thread Blake M. Sisco
okmy jquery knowledge is severely lacking and I can't figure out how the heck to get this to work...i've spent the last 2+ hours on it :-/ Could you give me an example of how i would set this up? Blake M. Sisco LOR Manufacturing Co., Inc Web Presence • Graphic Design www.lormfg.com (866)

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

2009-03-16 Thread mrts
On Mar 15, 5:56 pm, mrts wrote: > I don't, therefore I'm all for the critter and my (styled) take is > here:http://mrts-foo.appspot.com/ For anyone still interested in the critter, there are some banners now at http://mrts-foo.appspot.com/ .

Re: latitude/longitude field type

2009-03-16 Thread Dougal Matthews
That looks very cool for me and quite useful but I don't think the django-googlemap supports the DMS format. Also its not Django 1.0 ready. Sergio, Don't you just want to create a custom field with a regular expression validator for DMS? Dougal --- Dougal Matthews - @d0ugal

Re: Lookup across relations

2009-03-16 Thread Matías Costa
On Sun, Mar 15, 2009 at 2:54 PM, 3xM <3...@detfalskested.dk> wrote: > > Gees... It messed with my link. I'll try again: > http://blackfin.cannedtuna.org/django-testcase.tar.gz > > > It works OK here. I have added __rerpr__ method to models to get a clear output: for p in Project.objects.all():

Re: latitude/longitude field type

2009-03-16 Thread Javier Santana
GLatLng looks a good start: http://django-googlemap.googlecode.com/svn/trunk/geo/googlemap/models.py On Sun, Mar 15, 2009 at 11:32 PM, Sergio wrote: > > Hello, > > I'm working on field validation for latitude and longitude. I need to > validate them according to the DMS

Re: Conditional row coloring in django-admin changelist

2009-03-16 Thread Blake M. Sisco
Malcom, awesome i'll give it a try this morning and let you know how it workedthanks a ton Blake M. Sisco LOR Manufacturing Co., Inc Web Presence • Graphic Design www.lormfg.com (866) 644-8622 (888) 524-6292 FAX The information transmitted by Blake Sisco herewith is intended only for the