Re: Repetitive background tasks

2006-06-27 Thread Harish Mallipeddi
Thanks everyone for the replies. Anyways I looked at the kronos scheduler (pointed out by Canen above) being used in Turbogears and what I wanted is more like this. So currently the way I'm using this is to put kronos.py into the django utils directory and then importing it from there. In a part

Re: SuspiciousOperation: User tampered with session cookie

2006-06-27 Thread Patrick .J. Anderson
Malcolm Tredinnick wrote: > On Tue, 2006-06-27 at 23:09 -0500, Patrick .J. Anderson wrote: >> Jacob Kaplan-Moss wrote: >>> Hi Patrick -- >>> >>> What happens when you clear out your sessions table? >>> >>> FYI, there's nothing about Ubuntu versus mod_python that would/could >>> cause this (I use

Re: Problem with built-in User in many-to-many relationships

2006-06-27 Thread bsdlogical
Malcolm Tredinnick wrote: On Tue, 2006-06-27 at 23:53 -0400, bsdlogical wrote: I've recently stumbled over a problem whose solution I can't find. I have a class with two fields that use the built-in User class (from django.contrib.auth.models) in a many-to-many relationship. Howeve

Re: SuspiciousOperation: User tampered with session cookie

2006-06-27 Thread Malcolm Tredinnick
On Tue, 2006-06-27 at 23:09 -0500, Patrick .J. Anderson wrote: > Jacob Kaplan-Moss wrote: > > Hi Patrick -- > > > > What happens when you clear out your sessions table? > > > > FYI, there's nothing about Ubuntu versus mod_python that would/could > > cause this (I use both). > > > > Jacob > >

Re: SuspiciousOperation: User tampered with session cookie

2006-06-27 Thread Patrick .J. Anderson
Jacob Kaplan-Moss wrote: > Hi Patrick -- > > What happens when you clear out your sessions table? > > FYI, there's nothing about Ubuntu versus mod_python that would/could > cause this (I use both). > > Jacob > > > > I cleared the session table and tried to login using my apache/mod_python

Re: Problem with built-in User in many-to-many relationships

2006-06-27 Thread Malcolm Tredinnick
On Tue, 2006-06-27 at 23:53 -0400, bsdlogical wrote: > I've recently stumbled over a problem whose solution I can't find. I > have a class with two fields that use the built-in User class (from > django.contrib.auth.models) in a many-to-many relationship. However, > when I try to access or modify

Re: SuspiciousOperation: User tampered with session cookie

2006-06-27 Thread Patrick .J. Anderson
Nikolaus Schlemm wrote: >> I've heard that the problem might be related to md5 hashing (someone >> just recently posted it here in the groups with the same error >> message). I looked at the django code and that where that error message >> is thrown and it seemed to confirm that, but I don't know

Problem with built-in User in many-to-many relationships

2006-06-27 Thread bsdlogical
I've recently stumbled over a problem whose solution I can't find. I have a class with two fields that use the built-in User class (from django.contrib.auth.models) in a many-to-many relationship. However, when I try to access or modify those fields, django throws an error message. My class declar

Re: SuspiciousOperation: User tampered with session cookie

2006-06-27 Thread Jacob Kaplan-Moss
Hi Patrick -- What happens when you clear out your sessions table? FYI, there's nothing about Ubuntu versus mod_python that would/could cause this (I use both). Jacob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Grou

Re: SuspiciousOperation: User tampered with session cookie

2006-06-27 Thread Patrick .J. Anderson
Patrick .J. Anderson wrote: > [EMAIL PROTECTED] wrote: >> Clear the cookies in your browser and the problem will go away. >> >> > clearing the cookies doesn't help (I guess you answered that one). > > hmm, i don't know exactly what to do here, as I haven't tampered with > anything. I'll try to re

Re: Generic relations and tags

2006-06-27 Thread nkeric
Jay Parlar wrote: > That's a pretty neat way to do it, I'm going to have to try it out. Do > you use a ManyToManyField between your actual objects (like a blog > Post, for instance) and the ObjectTag? > > Jay P. hi Jay, Since the ObjectTag model is the m2m table between the actual object (which

Re: Django t-shirts: your ideas wanted!

2006-06-27 Thread Jacob Kaplan-Moss
On Jun 27, 2006, at 10:04 PM, Julio Nobrega wrote: > Django | Python: We indented jazz (some people say jazz' magic is > the space between the notes, a definition that I love) Ha -- that one makes me laugh... :) Jacob --~--~-~--~~~---~--~~ You received this mes

Re: Django t-shirts: your ideas wanted!

2006-06-27 Thread Julio Nobrega
You asked :) The green one from the flickr photo with this one liner in the back: ['hotclub' for name in frameworks if name is 'django'] Or this on the back: MVU (Just a play with the words. Controller is You, heh, heh? :p Okay...) Django: From Web 2.0 to Web Quintette Snakes o

Re: Django t-shirts: your ideas wanted!

2006-06-27 Thread Tyson Tate
I second these. It'd be nice if they came in Django-green, as well. -Tyson -- Tyson Tate - CalPoly Graphic Design Student - Work: Graphic Designer (CalPoly Library) - Play: Mustang Band, CalPoly Triathlon Team, Kappa Kappa Psi (Iota Pi) On Jun 27, 2006, at 11:57 AM, Don Arbow wrote: > These

Re: SuspiciousOperation: User tampered with session cookie

2006-06-27 Thread Patrick .J. Anderson
[EMAIL PROTECTED] wrote: > Clear the cookies in your browser and the problem will go away. > > > > > clearing the cookies doesn't help (I guess you answered that one). hmm, i don't know exactly what to do here, as I haven't tampered with anything. I'll try to recreate the project (extra work,

Re: Maintaining foreign key reference when foreign object gets deleted

2006-06-27 Thread James Bennett
On 6/27/06, mohan <[EMAIL PROTECTED]> wrote: > But then we would loose the relation between objects. A database can only maintain relationships between two objects if both objects actually exist in their respective tables. Deleting one or the other will always irretrievably destroy the relationsh

Re: syncdb error: django.contrib.markup: 'module' object has no attribute 'models'

2006-06-27 Thread Jay Parlar
On 6/27/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > > > The error message is the result of a recent addition (r3201) - it is an > indication that the named applications could not be imported, because of > some sort of error in the code - in this case, the request for a 'models' > attribut

Re: Maintaining foreign key reference when foreign object gets deleted

2006-06-27 Thread mohan
But then we would loose the relation between objects. We still want to maintain the information as to what was delivered to whom even though the centre gets deleted. Yes, we could maintain a couple of extra columns/tables to maintain the status. But this would mean looking for in mulitple places w

Re: Request_Response Problem

2006-06-27 Thread HoLin
Simon,Malcolm, thank you for your quick replies.:)I need to read the docs more carefull.On 6/28/06, Malcolm Tredinnick < [EMAIL PROTECTED]> wrote:On Wed, 2006-06-28 at 09:21 +0800, HoLin wrote: > hi all> I have a Query_String like this :> ?type_encode=0&domain=python&root=.cn&root=.com&root=.net>>

Re: Request_Response Problem

2006-06-27 Thread Malcolm Tredinnick
On Wed, 2006-06-28 at 09:21 +0800, HoLin wrote: > hi all > I have a Query_String like this : > ?type_encode=0&domain=python&root=.cn&root=.com&root=.net > > using request.REQUEST.get("root") can only get the last value *.net* > how can I get the right value of root? The behaviour of this dicit

Re: Request_Response Problem

2006-06-27 Thread Simon Willison
On 28 Jun 2006, at 02:21, HoLin wrote: > ?type_encode=0&domain=python&root=.cn&root=.com&root=.net > > using request.REQUEST.get("root") can only get the last value *.net* > how can I get the right value of root? request.GET.getlist('root') will get you back a list of all of the root= values

Request_Response Problem

2006-06-27 Thread HoLin
hi allI have a Query_String like this :?type_encode=0&domain=python&root=.cn&root=.com&root=.netusing request.REQUEST.get("root") can only get  the last value *.net*how can I get the right value of root? -- RegardsHoLin --~--~-~--~~~---~--~~ You received this messag

Re: syncdb error: django.contrib.markup: 'module' object has no attribute 'models'

2006-06-27 Thread Russell Keith-Magee
On 6/28/06, Jay Parlar <[EMAIL PROTECTED]> wrote: When running my Django instance (most up to date SVN) on Dreamhost,I've started seeing this:[chiclet]$ python2.4 manage.py syncdbError: None couldn't be installed, because there were errors in your model: django.contrib.humanize: 'module' object has

Re: syncdb error: django.contrib.markup: 'module' object has no attribute 'models'

2006-06-27 Thread Malcolm Tredinnick
On Tue, 2006-06-27 at 20:58 -0400, Jay Parlar wrote: > When running my Django instance (most up to date SVN) on Dreamhost, > I've started seeing this: > > [chiclet]$ python2.4 manage.py syncdb > Error: None couldn't be installed, because there were errors in your model: > django.contrib.humanize:

Re: Generic relations and tags

2006-06-27 Thread Jay Parlar
On 6/27/06, Luke Plant <[EMAIL PROTECTED]> wrote: > > On Tuesday 27 June 2006 18:06, Jay Parlar wrote: > > So I'm now trying the new generic relations out for tags, much like > > the example in the documentation. The problem I'm having is doing a > > filter() to get a QuerySet of tags with unique

syncdb error: django.contrib.markup: 'module' object has no attribute 'models'

2006-06-27 Thread Jay Parlar
When running my Django instance (most up to date SVN) on Dreamhost, I've started seeing this: [chiclet]$ python2.4 manage.py syncdb Error: None couldn't be installed, because there were errors in your model: django.contrib.humanize: 'module' object has no attribute 'models' django.contrib.markup:

Re: Null foreign key, is this possible?

2006-06-27 Thread Malcolm Tredinnick
On Tue, 2006-06-27 at 15:25 -0700, bahund wrote: > Hi, > > I have the following model which has a foreign key field that I would > like to be null at times: > > class Car(models.Model): > make = models.CharField(maxlength=100, core=True) > model = models.CharFeild(maxlength=100, core=Tru

Re: Generic relations and tags

2006-06-27 Thread Luke Plant
On Tuesday 27 June 2006 18:06, Jay Parlar wrote: > So I'm now trying the new generic relations out for tags, much like > the example in the documentation. The problem I'm having is doing a > filter() to get a QuerySet of tags with unique names. Any thoughts on > this? > > If two different objects

Null foreign key, is this possible?

2006-06-27 Thread bahund
Hi, I have the following model which has a foreign key field that I would like to be null at times: class Car(models.Model): make = models.CharField(maxlength=100, core=True) model = models.CharFeild(maxlength=100, core=True) date = models.DateTimeField(auto_now_add=True) forum =

Re: Checking For Existing Rows

2006-06-27 Thread Tyson Tate
Ah - I'm from a Java background, so knowing that Exceptions are cheap in Python suits me just fine. Thanks for the tips, all! -Tyson -- Tyson Tate - CalPoly Graphic Design Student - Work: Graphic Designer (CalPoly Library) - Play: Mustang Band, CalPoly Triathlon Team, Kappa Kappa Psi (Iota P

Re: Repetitive background tasks

2006-06-27 Thread canen
You could use kronos.py, found here http://snakelets.cvs.sourceforge.net/snakelets/Plugins/scheduler/kronos.py?view=markup turbogears uses it for its scheduler. You can find the tg implementation here http://trac.turbogears.org/turbogears/browser/branches/1.0/turbogears/scheduler.py?rev=1363 --~

Re: admin connection mysql problem

2006-06-27 Thread Andy Dustman
On 6/26/06, Patrick <[EMAIL PROTECTED]> wrote: > File "/usr/lib/python2.3/site-packages/MySQLdb/connections.py", line 151, > in __init__ > self.converter[types.StringType] = string_literal > > TypeError: object does not support item assignment I don't really know what the actual cause is,

Re: Django t-shirts: your ideas wanted!

2006-06-27 Thread Don Arbow
These seemed nice, not sure if they're the same as those below, these were at the Greenpeace Rails show and tell:http://www.flickr.com/photos/[EMAIL PROTECTED]/173107581/in/set-72157594174657013/http://www.flickr.com/photos/[EMAIL PROTECTED]/173107223/in/set-72157594174657013/DonOn Jun 27, 2006, at

Re: Problem authenticating static content in Apache

2006-06-27 Thread jacob
Ah... upgrading to the latest mod_python (3.2.8) seemed to fix the problem. 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@googlegrou

Re: How to select distinct rows?

2006-06-27 Thread Jacob Kaplan-Moss
On Jun 26, 2006, at 12:14 PM, Ville Säävuori wrote: > Say I have a model like > > class Example (models.Model): > ip = models.IPAddressField() > desc = models.CharField(maxlength=255) > created = models.DateTimeField(auto_now_add=True) > > How do I make a query that counts distin

Django t-shirts: your ideas wanted!

2006-06-27 Thread Jacob Kaplan-Moss
Howdy folks -- I'm about to print up some Django shirts to take to OSCON next month -- got any ideas? We gotta move pretty fast (we're going to try to get an order in to the printer this week) so if you've got any hot ideas (or designs, for that matter) send 'em to me! I'll mail anyone wh

Re: Generic relations and tags

2006-06-27 Thread Jay Parlar
On 6/27/06, nkeric <[EMAIL PROTECTED]> wrote: > > hi Jay, > > IMO, you will have to do the unique contrain in the db level, here is > the tagging model stuff I'm working on: > That's a pretty neat way to do it, I'm going to have to try it out. Do you use a ManyToManyField between your actual obje

Re: Errors using django.contrib.*.view

2006-06-27 Thread [EMAIL PROTECTED]
Sorry one last shot at this ... the import line in django.contrib.syndication.views should be: from django.contrib.syndication import feeds --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To p

Re: admin connection mysql problem

2006-06-27 Thread John DeRosa
Patrick Martini wrote: > Thanks for the answer :) > I have tries to start my site without installed application. > But the admin give me always the same problem. > > I have already broken two keyboards trying to risolve the problem :) > > Have you another suggestion ? nope, sorry!... --~--~--

Problem authenticating static content in Apache

2006-06-27 Thread jacob
I've got a working Django webapp that I'm happy with, running under mod_python, but I need to authenticate some static content served from Apache. The relevent part of my apache config looks like this: AuthType basic AuthName "attachments" Require valid-user SetEnv DJANGO_SETTI

Re: Errors using django.contrib.*.view

2006-06-27 Thread [EMAIL PROTECTED]
I suppose answering my own question shows that I was being a dolt ... which I was ... anyway this was just that I had forgotten about the prefix in urls.py ... ok .. so that works now, but it then causes an error with importing django.contrib.syndication.views.py where it tries to import django.co

Re: SuspiciousOperation: User tampered with session cookie

2006-06-27 Thread Nikolaus Schlemm
Am Dienstag, 27. Juni 2006 19:25 schrieb [EMAIL PROTECTED]: > Clear the cookies in your browser and the problem will go away. unfortunately that won't solve this problem - possibly another one ;) -- cheers, Nikl --~--~-~--~~~---~--~~ You received this mes

Re: Sniffing around django

2006-06-27 Thread toth anna
Tom, Arthur, thanks a lot. I was infected with java container things. I'm checking citated docs. (I thought after some reading, middleware will be an answer, so i'll checking middleware too :) Anna _ Teljes körű pénzügyi

Re: admin connection mysql problem

2006-06-27 Thread Patrick Martini
Thanks for the answer :) I have tries to start my site without installed application. But the admin give me always the same problem. I have already broken two keyboards trying to risolve the problem :) Have you another suggestion ? > > Oh well, sorry my suggestion didn't help. > > A brute force

Re: Generic relations and tags

2006-06-27 Thread nkeric
hi Jay, IMO, you will have to do the unique contrain in the db level, here is the tagging model stuff I'm working on: class Tag(models.Model): name = models.CharField(maxlength=40, unique=True, db_index=True) invisible = models.NullBooleanField(default=False) def __str__

Re: SuspiciousOperation: User tampered with session cookie

2006-06-27 Thread [EMAIL PROTECTED]
Clear the cookies in your browser and the problem will go away. --~--~-~--~~~---~--~~ 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: render to screen and dynamic file

2006-06-27 Thread Jay Parlar
On 6/26/06, Luis P. Mendes <[EMAIL PROTECTED]> wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > > Ok, I *think* I understand your problem a bit better. > > > > One thing you can do is store some information (filename, or > > something) in the session object for the user. Then it do

Re: admin connection mysql problem

2006-06-27 Thread John DeRosa
Oh well, sorry my suggestion didn't help. A brute force way, if nobody else can help, would be to remove classes one at a time from your model until the admin site works again. Narrow down and then isolate the problem code, and then stare at it for a real long time... John Patrick wrote: >

Generic relations and tags

2006-06-27 Thread Jay Parlar
So I'm now trying the new generic relations out for tags, much like the example in the documentation. The problem I'm having is doing a filter() to get a QuerySet of tags with unique names. Any thoughts on this? If two different objects are both given a tag "foo", there will be two tags in the sy

Re: Sniffing around django

2006-06-27 Thread Tom Tobin
On 6/27/06, Tom Tobin <[EMAIL PROTECTED]> wrote: > On 6/27/06, toth anna <[EMAIL PROTECTED]> wrote: > > > > Tom Tobin <[EMAIL PROTECTED]>: > > > You should be able to get the behavior you want by > > overriding the > > > save() method on your models. > > > > Is there any usable examples somewhere

Re: Sniffing around django

2006-06-27 Thread arthur debert
In your model, overide the save method : def save(self): # get number of objects maxNumber = 5 current = MyModel.objects.all().count() if current < maxNumber: super(MyModel, self).save() #you can either pass - object won't be saved, or raise an exception cheers, arthu

Re: Checking For Existing Rows

2006-06-27 Thread Daniel Poelzleithner
Tyson Tate wrote: > However, raising an exception on "success" irks the part of me that > studied computer science for 3 years, so I'm wondering if anyone > knows of any other ways I might be able to achieve the above in a > better way. Compared to other languages, exception in python are

Re: render to screen and dynamic file

2006-06-27 Thread Luis P. Mendes
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > Ok, I *think* I understand your problem a bit better. > > One thing you can do is store some information (filename, or > something) in the session object for the user. Then it doesn't matter > how long it takes for the user to press the button (un

Errors using django.contrib.*.view

2006-06-27 Thread [EMAIL PROTECTED]
I am trying to add syndication support to a django project and it seems to have trouble getting the view from django.contrib.syndication.view per the url.py setting ... I keep getting this error: Could not import listmgr.lister.views.django.contrib.syndication.views. Error was: No module named

Re: SuspiciousOperation: User tampered with session cookie

2006-06-27 Thread Nikolaus Schlemm
> I've heard that the problem might be related to md5 hashing (someone > just recently posted it here in the groups with the same error > message). I looked at the django code and that where that error message > is thrown and it seemed to confirm that, but I don't know why this > happens. simply t

Is this really a bug or did I messup

2006-06-27 Thread [EMAIL PROTECTED]
http://code.djangoproject.com/ticket/2243 here admin is calling set on a m2m class Resource(models.Model): name = models.CharField(maxlength=200) class Admin: pass class Plan(models.Model): name = models.CharField(maxlength=200) class Admin:

Re: Sniffing around django

2006-06-27 Thread Tom Tobin
On 6/27/06, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote: > > On Jun 27, 2006, at 9:58 AM, toth anna wrote: > > I'm working on my thesis in our academy (i have to > > implement, too). > > Searching for an enviroment, i found django, and it looks > > very nice. > > After reading tutorial, i have som

Re: Sniffing around django

2006-06-27 Thread Jacob Kaplan-Moss
On Jun 27, 2006, at 9:58 AM, toth anna wrote: > I'm working on my thesis in our academy (i have to > implement, too). > Searching for an enviroment, i found django, and it looks > very nice. > After reading tutorial, i have some questions (and more to > come...:) before i fall in love with it. > >

Re: SuspiciousOperation: User tampered with session cookie

2006-06-27 Thread Joseph Kocherhans
On 6/27/06, Patrick J. Anderson <[EMAIL PROTECTED]> wrote: > > I've heard that the problem might be related to md5 hashing (someone > just recently posted it here in the groups with the same error > message). I suspect that it is. I've run into the same problem when I inadvertently changed the SE

Re: Is it possible to do this from templates?

2006-06-27 Thread Jay Parlar
On 6/27/06, PythonistL <[EMAIL PROTECTED]> wrote: > > Hi, > Is it possible to test ,if an image exists, from a template? > To explain: > Let's suppose in my template I use > > > and {{ImageName}} is a picture that can exists but it needn't. > But if it does not exist, then I will receive an ugly

Re: SuspiciousOperation: User tampered with session cookie

2006-06-27 Thread Patrick J. Anderson
Hmm, I haven't changed domains. I simply took my previous setup on Fedora Core 5 with apache+mod_python and put it on Ubuntu Dapper with apache+mod_python. I've heard that the problem might be related to md5 hashing (someone just recently posted it here in the groups with the same error message).

Is it possible to do this from templates?

2006-06-27 Thread PythonistL
Hi, Is it possible to test ,if an image exists, from a template? To explain: Let's suppose in my template I use and {{ImageName}} is a picture that can exists but it needn't. But if it does not exist, then I will receive an ugly picture in my view (HTML)result. So, I test that in my view but it

Re: Repetitive background tasks

2006-06-27 Thread Jay Parlar
On 6/27/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > On Mon, 2006-06-26 at 13:28 -0700, Tyson Tate wrote: > > I've found a better solution with signals and the dispatcher. The > > essence is that you raise a signal every time someone views the > > relevant page, for instance, a "Recent Fl

Re: Anyone got PyTextile?

2006-06-27 Thread Jarek Zgoda
Thomas Ashelford wrote: > I've been trying to source a copy of PyTextile 1.3 to use in a Django > application I'm building, but the dealmeida.net server is down. Is > there any kind soul out there who could email a copy at > thomas-at-ether.com.au? Look at Cheeseshop for pytextile-mirror. Cheer

Re: generating md5-hashes in modpython fails

2006-06-27 Thread Nikolaus Schlemm
I forgot to append this file... -- cheers, Nikl --~--~-~--~~~---~--~~ 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 t

Re: Adding search functionality

2006-06-27 Thread Kristoffer
Works like a charm! Thanks a lot! -Kristoffer --~--~-~--~~~---~--~~ 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,

RE: Time Tracking Tool

2006-06-27 Thread Sells, Fred
I thought I saw something like this on sourceforge -Original Message- From: django-users@googlegroups.com [mailto:[EMAIL PROTECTED] Behalf Of Ian Holsman Sent: Tuesday, June 27, 2006 6:26 AM To: django-users@googlegroups.com Subject: Re: Time Tracking Tool Importance: Low On 27/06/200

generating md5-hashes in modpython fails

2006-06-27 Thread Nikolaus Schlemm
hi all, for some (up to now) unknown reasons the generation of md5-hashes fails in modpython (for me and at least one other user on irc). I discovered this bug while switching a django-setup from the builtin dev-server to modpython: it complained that I had tampered with the session cookies - w

Re: Repetitive background tasks

2006-06-27 Thread Malcolm Tredinnick
On Mon, 2006-06-26 at 13:28 -0700, Tyson Tate wrote: > > On Jun 26, 2006, at 12:43 PM, Glenn Tenney wrote: > > > > [...] > > 2) Also within your application, write a global function that (a) > > immediately checks to see if it's the first time it's invoked each day > > (or whatever interval), and

Re: Adding search functionality

2006-06-27 Thread Guillermo Fernandez Castellanos
Hi, It's not a "copy/paste" code. As I told you, it comes from the admin view. The self correspond to a more complex construct in the admin. You can find the full code here: \django\contrib\admin\views\main.py line 712 But it's not easy to understand at first sight. But I think the problem is t

Re: Time Tracking Tool

2006-06-27 Thread Jos Yule
Thanks, i'll check those two packages out. I have the NIH syndrome down pretty good. ;) --~--~-~--~~~---~--~~ 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@googleg

Re: Checking For Existing Rows

2006-06-27 Thread DavidA
You could just check the count of that many items (since its unique it should always be 1 or 0): if Photo.objects.filter(flickr_id=photo("id")).count() == 0: # create the object ... But its my understanding that Python exceptions are not as heavy weight as they are in languages like

Re: Adding search functionality

2006-06-27 Thread Kristoffer
Thank you, I have upgraded to 0.9.5 now. Still can't get it to work, though. What does "self" refer to in "other_qs = QuerySet(self.model)" ? I changed it to Document, my class that represents an article: def search(request): query = request.POST['query'] or_query=Q() sea

Re: Checking For Existing Rows

2006-06-27 Thread Ian Holsman
http://www.djangoproject.com/documentation/models/get_or_create/ ? but yeah.. besides from using get_or_create, the exception route is probably the easiest route. On 27/06/2006, at 4:58 PM, Tyson Tate wrote: > > In one of my apps, I need to check and see if a row already exists > based on a u

Re: Time Tracking Tool

2006-06-27 Thread Ian Holsman
On 27/06/2006, at 6:48 AM, Jos Yule wrote: > > I'm in the prototype phase for designing a time tracking/invoicing > tool > for my small business. First i'd like to know if anyone has already > done this kind of thing? > > If not, i'd like to make something available to other looking for this >

Re: Model vanishes from Admin

2006-06-27 Thread [EMAIL PROTECTED]
Okay what solved my problem was removing imports of my models from urls.py. I had a few generic view wrappers that were short so I had just defined them in urls.py for now and that was causing a problem when django was launched from fastcgi or mod_python but not django-admin.py runserver. --~--~

Re: New vim files for Django available

2006-06-27 Thread Marc Fargas
That's nice!Didn't notice vim 7.0 had django syntax highlighting! Good work.Cheers,Marc.On 6/27/06, Jeroen Ruigrok van der Werven < [EMAIL PROTECTED]> wrote:At http://www.vim.org/scripts/script.php?script_id=1487 you can findthe latest versions (1.02, released 2006-06-26) of Dave Hodder'sdjango.vi

Re: Maintaining foreign key reference when foreign object gets deleted

2006-06-27 Thread Michael Radziej
mohan wrote: > Hi, > > I have the following 3 models with one model having a foreign key > reference to another model. > > class DeliveryBatch(models.Model): > delivered_to = models.ForeignKey(Centre) > ... > > class Centre(models.Model): > is_deleted = models.BooleanField(default=

Re: How to select distinct rows?

2006-06-27 Thread SmileyChris
I don't think GROUP BY is part of the Django ORM, but you can easily use raw SQL in a custom method to achieve this: http://www.djangoproject.com/documentation/models/custom_methods/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Adding search functionality

2006-06-27 Thread Simon Willison
On 27 Jun 2006, at 08:53, Kristoffer wrote: > I can import Q with "from django.core.meta import Q", but I can't find > QuerySet. Did it exist in version 0.91? No. QuerySet is part of the vastly superior magic-removal ORM, which was introduced in Django 0.9.5. There are instructions on upgradi

Re: Adding search functionality

2006-06-27 Thread Kristoffer
Thank you very much for your help! This seems to be exactly what I would like to do! However, your source seems to be for another version of Django than I run (I have version 0.91) I can import Q with "from django.core.meta import Q", but I can't find QuerySet. Did it exist in version 0.91? Than

Re: admin connection mysql problem

2006-06-27 Thread Patrick Martini
Now i have tried only the default admin page without any app and the results are the same John DeRosa wrote: > When I've seen messages similar to this, it's usually because an > identifier in the meta.Admin list_display list was not defined as a > field in the class. A good place to start woul

New vim files for Django available

2006-06-27 Thread Jeroen Ruigrok van der Werven
At http://www.vim.org/scripts/script.php?script_id=1487 you can find the latest versions (1.02, released 2006-06-26) of Dave Hodder's django.vim and htmldjango.vim. -- Jeroen Ruigrok van der Werven --~--~-~--~~~---~--~~ You received this message because you are s

mproperlyConfigured: Middleware module

2006-06-27 Thread Patrick Martini
I have some problem with Django and mod_python (3.1.3.3). With runserver all works fine but qith apache I receive always this message. Mod_python error: "PythonHandler django.core.handlers.modpython" Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/mod_python/apache.p