Re: ANN: Security fix to i18n framework

2007-10-30 Thread Jeremy Dunck
On 10/31/07, Jason Cui <[EMAIL PROTECTED]> wrote: > 2007/10/31, Malcolm Tredinnick <[EMAIL PROTECTED]>: > > > > On Tue, 2007-10-30 at 00:37 -0700, Jason Cui wrote: > > > When I update my site from 0.96 to 0.96.1,my internationalize function > > > won't work for firefox, but fine for IE. > > > I us

Re: the old django-in-a-subdirectory problem

2007-10-30 Thread Graham Dumpleton
On Oct 31, 1:58 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Tue, 2007-10-30 at 22:20 +, Graham Dumpleton wrote: > > On Oct 31, 1:15 am, [EMAIL PROTECTED] wrote: > > > This issue has come up for many people in many places, but most of the > > > threads seem old, and none of the sol

earn money by clicking and viewing ads

2007-10-30 Thread Aranga Wijesinghe
*http://www.clixsense.com/?2241339* ** *here try this clicking because u can earn and this is not a scam.* *U can earn not only clicking on ads by reffering other to this site and by upgrading your account also. So go and try this out.* --~--~-~--~~~---~--~~ You re

How to write the new DualSessionMiddleware for django trunk?

2007-10-30 Thread Jason Cui
I use this code for the "Remember me" function: http://code.djangoproject.com/wiki/CookBookDualSessionMiddleware But then I update django from 0.96 to svn trunk, it won't work, because the session middleware of django have not SessionWrapper class any more. What should I do now? --~--~-~

Re: ANN: Security fix to i18n framework

2007-10-30 Thread Jason Cui
2007/10/31, Malcolm Tredinnick <[EMAIL PROTECTED]>: > > > On Tue, 2007-10-30 at 00:37 -0700, Jason Cui wrote: > > When I update my site from 0.96 to 0.96.1,my internationalize function > > won't work for firefox, but fine for IE. > > I use english in views and templates, and trans it to chinese in

Re: the old django-in-a-subdirectory problem

2007-10-30 Thread Kenneth Gonsalves
On 31-Oct-07, at 10:36 AM, Kenneth Gonsalves wrote: >> think it's been simple as that all along, and I've just been tripped >> up by using webfaction's control panel... > > I just treat it as a shell account - removed what they did and set up > my own. Only needed the control panel to set up the

Re: the old django-in-a-subdirectory problem

2007-10-30 Thread Kenneth Gonsalves
On 31-Oct-07, at 10:24 AM, [EMAIL PROTECTED] wrote: > If you didn't use the control panel to mount the django installation > at /web, did you have to do anything else special to get it to work > properly, besides adding a ^web/ prefix to your url files? I'd hate to > think it's been simple as th

Re: the old django-in-a-subdirectory problem

2007-10-30 Thread girzel
Thanks, Kenneth and Karen... > Wrong order, you won't need the 500.html (nearly as much) once all the bugs > are worked out, many of which you will find while getting the front page to > work! :) Ha! Understood. > So, I think you can fix it by including the trailing slash in all your links > in

Re: simple model with won't pass doctest that passes in a unicode string

2007-10-30 Thread Wiley
Malcom, Thanks _so_ much for this. I've learned a great deal from you both from your responses on this forum and by reading your blog. I will continue to work on this issue and post to the thread if I come up with anything of archival value. Wiley On Oct 31, 10:33 am, Malcolm Tredinnick <[EMA

Re: the old django-in-a-subdirectory problem

2007-10-30 Thread Kenneth Gonsalves
On 31-Oct-07, at 9:06 AM, Malcolm Tredinnick wrote: >> Part of the problem may come from the fact I'm hosting this on >> WebFaction, and in their control panel the django installation is >> rooted at /django. I'm guessing (though few of my guesses have panned >> out so far) that that setup sends

Re: the old django-in-a-subdirectory problem

2007-10-30 Thread Karen Tracey
On 10/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > http://taojian.webfactional.com/django/InnerWorks/ works fine from > here, try once more? Yeah, I got the error at first too but now it is working. > I get back a 500 status code (and you really need to create a 500.html > > template,

Re: ANN: Satchmo 0.6 Released

2007-10-30 Thread Jeremy Dunck
On 10/30/07, Chris Moffitt <[EMAIL PROTECTED]> wrote: > > After a little bit of confusion with my rss feed, I am very pleased to > announce that release 0.6 of Satchmo is really available now. Congratulations. ... > You can learn more by visiting the main satchmo site at - > http://www.satchmopr

Re: the old django-in-a-subdirectory problem

2007-10-30 Thread girzel
http://taojian.webfactional.com/django/InnerWorks/ works fine from here, try once more? > I get back a 500 status code (and you really need to create a 500.html > template, btw). I'm saving all that for after I've got the front page working properly :) --~--~-~--~~~

Re: the old django-in-a-subdirectory problem

2007-10-30 Thread Malcolm Tredinnick
On Tue, 2007-10-30 at 20:29 -0700, [EMAIL PROTECTED] wrote: > > You haven't really provided enough details for me, at least, to know > > what you're doing here. > > Thanks very much for taking the time to look at this, the whole thing > has been very frustrating... > > Part of the problem may co

Re: MacOS X Leopard + mod_pyton + mysql problems

2007-10-30 Thread [EMAIL PROTECTED]
Argh. The "Universal" version of MySQL includes only: ppc, ppc64, i386 [Macintosh:src/mysql-5.0.45-osx10.4-universal/lib] benha% file libmysqlclient_r.a libmysqlclient_r.a: Mach-O universal binary with 3 architectures libmysqlclient_r.a (for architecture i386): current ar archive libmysqlcl

Re: the old django-in-a-subdirectory problem

2007-10-30 Thread girzel
> You haven't really provided enough details for me, at least, to know > what you're doing here. Thanks very much for taking the time to look at this, the whole thing has been very frustrating... Part of the problem may come from the fact I'm hosting this on WebFaction, and in their control pane

ANN: Satchmo 0.6 Released

2007-10-30 Thread Chris Moffitt
After a little bit of confusion with my rss feed, I am very pleased to announce that release 0.6 of Satchmo is really available now. Satchmo is an Open Source framework for creating unique and robust online stores. It is developed using the Django framework and has many features, including: - 10

Re: ANN: Security fix to i18n framework

2007-10-30 Thread Malcolm Tredinnick
On Tue, 2007-10-30 at 00:37 -0700, Jason Cui wrote: > When I update my site from 0.96 to 0.96.1,my internationalize function > won't work for firefox, but fine for IE. > I use english in views and templates, and trans it to chinese in po > file, and I have to local folder named en and zh, now, any

Re: ANN: Security fix to i18n framework

2007-10-30 Thread Malcolm Tredinnick
On Tue, 2007-10-30 at 00:41 -0700, Jason Cui wrote: > And more,when I update the django to svn trunk, my site is down, it > only show IE's 500 error, and I can't find the details. > I use lighttpd+FastCGI, there is no message in the error log file. > And, I use the DualSessionMiddleware class for

Re: Lost in why "UnicodeDecodeError" on changeset 6601

2007-10-30 Thread Malcolm Tredinnick
On Tue, 2007-10-30 at 21:02 +, mamcxyz wrote: > I run this script and still get the errors. I think the problem is > elsewhere but how know? You've failed to look at my initial response to this: calling count() on a Unicode string with UTF-8 as the argument to count() won't work. Re-read all

Re: @login_required and sending user back to original page

2007-10-30 Thread Malcolm Tredinnick
On Tue, 2007-10-30 at 17:01 -0700, crybaby wrote: > I have added @login_required decorator in one of my view functions. > When I request page that has login decorator, I get routed to this > url: > http://127.0.0.1:8000/login/?next=/post/create/ > > After I login, it goes to this url: > http://12

Re: Dictionnary problem trough session

2007-10-30 Thread Malcolm Tredinnick
On Tue, 2007-10-30 at 16:40 -0400, Francis Lavoie wrote: > Hi, > > > I have a shopping_cart class that I use with a session to store orders > information. > > > In this shopping cart, I have other object like customer contact. > > > class CustomerContact: > def __init__(self): >

Re: the old django-in-a-subdirectory problem

2007-10-30 Thread Malcolm Tredinnick
On Tue, 2007-10-30 at 22:20 +, Graham Dumpleton wrote: > On Oct 31, 1:15 am, [EMAIL PROTECTED] wrote: > > This issue has come up for many people in many places, but most of the > > threads seem old, and none of the solutions proposed has helped. > > > > I have a django installation in a subdir

Re: lookup spanning apps

2007-10-30 Thread Malcolm Tredinnick
On Tue, 2007-10-30 at 13:16 +, Wiley wrote: > I've run into a problem with a lookup that follows a long long chain > of foreign key relationships spanning two apps (two groups of database > tables with different app label prefixes)... > > the error is: table name > "a_long__list__of__relation

Re: Caching querysets

2007-10-30 Thread Malcolm Tredinnick
On Tue, 2007-10-30 at 05:43 -0700, Joe wrote: > I am running into a performace problem with Django and scaling. > > I have enabled the caching middleware, but had to set > CACHE_MIDDLEWARE_ANONYMOUS_ONLY=True so I could continue to use the > admin interface. > > Now, authenticated users are begi

Re: Model/Required Fields Questions

2007-10-30 Thread @@
hi maybe you can try this: create a new class represent the traffic type( such as Carpool, and all those traffic type ), add a class represent the traffic category(roadtrip,commute... ). the Rideshare class hava a reference to the traffic type, and the traffic type have a reference to the traffic c

Re: the old django-in-a-subdirectory problem

2007-10-30 Thread Malcolm Tredinnick
On Tue, 2007-10-30 at 18:31 +0800, Eric Abrahamsen wrote: > This issue has come up for many people in many places, but most of > the threads seem old, and none of the solutions proposed has helped. > > I have a django installation in a subdirectory of a site, like so: > www.mysite.com/django.

Re: simple model with won't pass doctest that passes in a unicode string

2007-10-30 Thread Malcolm Tredinnick
On Tue, 2007-10-30 at 07:26 +, Wiley wrote: > Hi all, > > I'm writing a doctest for a simple model and I can't get it to pass. > > The problem seems to be that no matter how I enter the data into the > test db, whether as a Unicode string or a utf-8 bytestring, and no > matter what I tell my

Model/Required Fields Questions

2007-10-30 Thread Alex Ezell
Hi, I am, as it will become painfully obvious, a new Django user. I am converting a PHP site to Django. Right now, the main DB table in the PHP site has around 100 columns and depending on the type of post being saved, it may leave around 60 of those empty. That's obviously an issue and I'd like

Re: cursor.execute returns LONG

2007-10-30 Thread Malcolm Tredinnick
On Tue, 2007-10-30 at 17:35 +, [EMAIL PROTECTED] wrote: > it returns a number type LONG but it schould not. Why not? You haven't explained why this is an error. If you think the type is a problem, you're mistaken: a long is just a number. If you think the fact that it's returning a number is

Re: Chaining Filters for many-to-many

2007-10-30 Thread Malcolm Tredinnick
On Wed, 2007-10-31 at 08:38 +1030, Darryl Ross wrote: > Kevin wrote: > > > models.TestLine.objects.filter(dimm__size=1024).filter(dimm__size=2048) > > > > This returns an empty set, but I know there is a test with multiple > > dimm objects and meets this criteria. Is there a limitation that I'm

Re: MacOS X Leopard + mod_pyton + mysql problems

2007-10-30 Thread [EMAIL PROTECTED]
Stuck in the same place. I'm guessing you d/l'd and installed the MySQL OSX 10.4 x86 installer package from MySQL. I did. I think it's only i386. They also have a Universal Binary OSX 10.4 file up there, but only in Tar format. I'm d/l'ing that now to try. Hopefully it's got the x86_64 image

Re: the old django-in-a-subdirectory problem

2007-10-30 Thread girzel
On Oct 31, 6:20 am, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On Oct 31, 1:15 am, [EMAIL PROTECTED] wrote: > If you use mod_wsgi, it contains instructions for how to mount > application on a sub url rather than at root. To make it all work > requires doing a workaround in the WSGI wrapper ar

Re: Table Locks with Django? (MyISAM)

2007-10-30 Thread Karen Tracey
Re: my confusion, I guess your view code could be relying on MySQL to block any reads from the table while any thread held the write lock, so that is why you say the view code did nothing with locks? In which case you are right, I don't understand how that thread would get an OperationalError rela

Re: serving django project through ssl and without ssl at the same time?!

2007-10-30 Thread Graham Dumpleton
I have documented workaround for mod_wsgi for older versions of Django where HTTPS was detected incorrectly. See: http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango Specifically, use a little wrapper: import django.core.handlers.wsgi _application = django.core.handlers.wsgi.WSGI

@login_required and sending user back to original page

2007-10-30 Thread crybaby
I have added @login_required decorator in one of my view functions. When I request page that has login decorator, I get routed to this url: http://127.0.0.1:8000/login/?next=/post/create/ After I login, it goes to this url: http://127.0.0.1:8000/accounts/profile/ What I want it to do is, send th

Re: serving django project through ssl and without ssl at the same time?!

2007-10-30 Thread Jeremy Dunck
On 10/30/07, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > > On Oct 31, 10:23 am, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: ... > > This is the current logic: > > return 'HTTPS' in self._req.subprocess_env and > > self._req.subprocess_env['HTTPS'] == 'on' > > Hmmm, using req.is_https() was put bac

Re: serving django project through ssl and without ssl at the same time?!

2007-10-30 Thread Graham Dumpleton
On Oct 31, 10:23 am, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > On 10/30/07, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > ... > > > In mod_wsgi, although the application entry point is defined twice, > > mod_wsgi will recognise that they are on 80/443 for the same site and > > ensure that only o

Re: Table Locks with Django? (MyISAM)

2007-10-30 Thread Karen Tracey
On 10/30/07, Peter <[EMAIL PROTECTED]> wrote: > > This worked in the trivial case of one user in the django python > shell. > > However, when I tried to load a page that tried to read the table - > while it was still write locked - the page was not returning (as I > would expect), so I unlocked the

Re: serving django project through ssl and without ssl at the same time?!

2007-10-30 Thread Jeremy Dunck
On 10/30/07, Graham Dumpleton <[EMAIL PROTECTED]> wrote: ... > In mod_wsgi, although the application entry point is defined twice, > mod_wsgi will recognise that they are on 80/443 for the same site and > ensure that only one Django instance runs in each Apache process, but > with both HTTP and HT

Re: MacOS X Leopard + mod_pyton + mysql problems

2007-10-30 Thread Graham Dumpleton
On Oct 31, 6:57 am, crudolph <[EMAIL PROTECTED]> wrote: > Yeah - I downloaded fromhttp://sourceforge.net/projects/mysql-python, > unzipped and ran python setup.py build and then install. > > Under Leopard (10.5) apache2 is 4-way, so it is running in 64-bit > mode. I haven't been able to figure out

Re: Detecting changed fields when saving an object

2007-10-30 Thread Ben
On Oct 30, 10:33 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > That's the basic idea, anyway. Hope this helps. Spot on, it was overriding __init__() that does it :) Many thanks, Ben. --~--~-~--~~~---~--~~ You received this message because you are subscribed t

the old django-in-a-subdirectory problem

2007-10-30 Thread Eric Abrahamsen
This issue has come up for many people in many places, but most of the threads seem old, and none of the solutions proposed has helped. I have a django installation in a subdirectory of a site, like so: www.mysite.com/django. At first I noticed a problem with the admin login, like other peo

Re: Detecting changed fields when saving an object

2007-10-30 Thread Marty Alchin
On 10/30/07, Ben <[EMAIL PROTECTED]> wrote: > I don't specifically need the before value, I need to know which of > the fields have changed. Okay, well, it still raises the same question, anyway. But, regardless, you pretty much have two options: - Store the values when the object is instantiat

Table Locks with Django? (MyISAM)

2007-10-30 Thread Peter
Is there any way to do a table lock through the django database api? I can't find information on it anywhere. Hi all, I'm using MySQL MyISAM tables, which means transactions don't work -- but they do support table locks. If not directly through the django api, is there some hybrid of raw SQL an

Re: Detecting changed fields when saving an object

2007-10-30 Thread Ben
On Oct 30, 10:07 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > Is there a particular reason you need the before and after, instead of > just the after? Getting the before values would either require an > additional query during your save, or you'd have to overload the > __init__ method to store

Re: the old django-in-a-subdirectory problem

2007-10-30 Thread Graham Dumpleton
On Oct 31, 1:15 am, [EMAIL PROTECTED] wrote: > This issue has come up for many people in many places, but most of the > threads seem old, and none of the solutions proposed has helped. > > I have a django installation in a subdirectory of a site, like > so:www.mysite.com/django. At first I notice

Re: Comparing date

2007-10-30 Thread Nicolas Steinmetz
Doug B a écrit : > Try just using the year attribute on the datetime instance. > > {% ifequal training.start_date.year training.end_date.year %} > ... Thanks a lot. It works ! Nicolas --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Chaining Filters for many-to-many

2007-10-30 Thread Darryl Ross
Kevin wrote: > models.TestLine.objects.filter(dimm__size=1024).filter(dimm__size=2048) > > This returns an empty set, but I know there is a test with multiple > dimm objects and meets this criteria. Is there a limitation that I'm > missing here? Is there an alternative method to accomplish the in

Re: Detecting changed fields when saving an object

2007-10-30 Thread Marty Alchin
On 10/30/07, Ben <[EMAIL PROTECTED]> wrote: > Actually, that's given me ideas but I can't seem to work out how to do > what I want. That works by simply storing the values after the change > each time the model is updated. However, I don't seem to have both the > before and after values in a singl

Re: serving django project through ssl and without ssl at the same time?!

2007-10-30 Thread Graham Dumpleton
On Oct 31, 6:50 am, lmierzej <[EMAIL PROTECTED]> wrote: > > maybe I should just create two apache virtual hosts pointing to the > > same django project? > > According to instructions herehttp://www.djangosnippets.org/snippets/240/ > there should be two different apache virtual hosts pointing to th

Dictionnary problem trough session

2007-10-30 Thread Francis Lavoie
Hi, I have a shopping_cart class that I use with a session to store orders information. In this shopping cart, I have other object like customer contact. class CustomerContact: def __init__(self): self.address = {} def add_address(self, add_dict, Company, Contact, Address,

Re: MacOS X Leopard + mod_pyton + mysql problems

2007-10-30 Thread Graham Dumpleton
I am actually surprised you got mod_python working in the first place unless you did some fiddles you haven't mentioned here. We have been sorting out issues with mod_python and mod_wsgi not working on Leopard over on the mod_python list. Short answer is, try editing src/Makefile in mod_python af

Re: Detecting changed fields when saving an object

2007-10-30 Thread Ben
On Oct 30, 7:31 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 10/30/07, Ben <[EMAIL PROTECTED]> wrote: > > > I'm trying to create an audit trail for a particular model, capturing > > all changes made on the objects. > > You might want to read this: > > http://code.djangoproject.com/wiki/Audi

Re: Lost in why "UnicodeDecodeError" on changeset 6601

2007-10-30 Thread mamcxyz
I run this script and still get the errors. I think the problem is elsewhere but how know? import codecs import os DIR = r"F:\Proyectos\Python\jhonWeb\shared\core\templates\core" arc=os.listdir(DIR) def write(file,text): # Open a UTF-8 file in read mode infile = codecs.open(file, "w",

Re: Lost in why "UnicodeDecodeError" on changeset 6601

2007-10-30 Thread mamcxyz
I use ultra-edit to change all files to utf8 and still get the same problem. About the questions: * The database is sqlite, created by the test runner * The type of text is unicode (u'http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---

Re: MacOS X Leopard + mod_pyton + mysql problems

2007-10-30 Thread crudolph
Yeah - I downloaded from http://sourceforge.net/projects/mysql-python, unzipped and ran python setup.py build and then install. Under Leopard (10.5) apache2 is 4-way, so it is running in 64-bit mode. I haven't been able to figure out how to pass the right architecture flags through setup.py cc -

Re: serving django project through ssl and without ssl at the same time?!

2007-10-30 Thread lmierzej
> maybe I should just create two apache virtual hosts pointing to the > same django project? According to instructions here http://www.djangosnippets.org/snippets/240/ there should be two different apache virtual hosts pointing to the same django project. Anyone using some other solutions? --~

Re: Detecting changed fields when saving an object

2007-10-30 Thread Ben
On Oct 30, 7:31 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 10/30/07, Ben <[EMAIL PROTECTED]> wrote: > > > I'm trying to create an audit trail for a particular model, capturing > > all changes made on the objects. > > You might want to read this: > > http://code.djangoproject.com/wiki/Audi

Re: Detecting changed fields when saving an object

2007-10-30 Thread James Bennett
On 10/30/07, Ben <[EMAIL PROTECTED]> wrote: > I'm trying to create an audit trail for a particular model, capturing > all changes made on the objects. You might want to read this: http://code.djangoproject.com/wiki/AuditTrail -- "Bureaucrat Conrad, you are technically correct -- the best kind

Detecting changed fields when saving an object

2007-10-30 Thread Ben
I'm trying to create an audit trail for a particular model, capturing all changes made on the objects. My immediate idea was to subclass the save() method on the model and compare the values both before and after calling the parent save method. This would work, but it would mean I would have to u

Re: cursor.execute returns LONG

2007-10-30 Thread [EMAIL PROTECTED]
> If you want to write code that will work for all backends, you must limit > your code to behavior that is defined in the spec. In this specific case it > means you should call fetchall on the cursor object, not the return value of > execute. thanks, that did the job :) --~--~-~--~--

Re: Caching, sidebar, oh my...

2007-10-30 Thread Udi
Yeah, just use the low-level caching framework. from django.core.cache import cache def get_common_thing(): cache_key = 'common_thing' t = cache.get(cache_key) if not t: qs = YourModel.objects.filter(whatever = something).select_related()[:20] cache.set(cache_key, list

Re: Scaling architecture question: separate media server

2007-10-30 Thread Udi
I've just moved my media to a separate server. I run an rsync over ssh whenever a user uploads a new profile image. Seems to work ok so far. The pain points are: 1) Setting up ssh keys so this can run unattended. 2) Because of (1), I had to run apache as a new user that has the right permissi

Re: using newforms, an uncommon case.

2007-10-30 Thread RajeshD
Here's a different approach: You could serialize an incomplete form instance to another table (could just be serialized to the user's session too.) Then, when the user requests to continue filling out an incomplete form, just deserialize the form instance and you have the form exactly as the user

Re: access property of related model instance?

2007-10-30 Thread Marty Alchin
On 10/30/07, cjl <[EMAIL PROTECTED]> wrote: > > def save(self): > > self.account.current_balance += self.amount > > self.account.save() > > super(Transaction, self).save() > > That did the trick, thank you. I'm glad to hear that. On second thought, though, you might want to move self.

Re: using newforms, an uncommon case.

2007-10-30 Thread Milan Andric
On Oct 30, 12:27 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > Basically, you'd write pend() to take care of storing an in-progress > form, and save() for processing a completed form. Then you have a > couple options on deciding when to call which one. Also, I'll leave > pulling up a pended

Re: access property of related model instance?

2007-10-30 Thread cjl
MA: > When you say "doesn't work" does it give you an error, or does it just > not update the account balance? You are correct, there was no error, it just didn't update the balance. > def save(self): > self.account.current_balance += self.amount > self.account.save() > super(Transa

Re: cursor.execute returns LONG

2007-10-30 Thread Karen Tracey
On 10/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > So I have a function in views: > # > def getEntries(user): > """Returns unique entries and page views for each of last 30 day > """ > cursor = connection.cursor() > query = cursor.execute('SELECT

Re: access property of related model instance?

2007-10-30 Thread Marty Alchin
On 10/30/07, cjl <[EMAIL PROTECTED]> wrote: > class Transaction(models.Model): > ... > def save(self): > self.account.current_balance = self.account.current_balance + > self.amount > super(Transaction, self).save() > > This does not work. How do I access the 'current_balan

Re: MacOS X Leopard + mod_pyton + mysql problems

2007-10-30 Thread Miller Hooks
I had some issues with mysqldb when I was setting it up on my mac, this article helped me a lot. http://dotnet.org.za/ncode/archive/2007/01/31/setting-up-mysql-for-python-mysqldb-on-mac-os-x-2.aspx The comments on it were really the key. Joseph Heck wrote: > Hey Chris, > > How did you install

Re: using newforms, an uncommon case.

2007-10-30 Thread Scott SA
On 10/30/07, Milan Andric ([EMAIL PROTECTED]) wrote: >I'm writing an application form (allow people to apply for a workshop) >and we allow the applicant to submit unfinished applications because >they can return to complete them at a later date. So most of the >model fields are blank=True. Mos

access property of related model instance?

2007-10-30 Thread cjl
Let's say I have two classes: class Account(models.Model): ... current_balance = models.DecimalField(max_digits=12, decimal_places=2) ... class Transaction(models.Model): ... account = models.ForeignKey(Account) amount = models.DecimalField(max_digits=12, decimal_places=2

nucular and django? comments?

2007-10-30 Thread Aaron Watters
Hi folks. I recently released a very lightweight fielded/full text search engine for Python called NUCULAR. details: http://nucular.sourceforge.net It should be brain-dead easy to use this with Django. I would be interested in any comments, ideas or suggestions about this package and whether i

Re: Comparing date

2007-10-30 Thread Doug B
Try just using the year attribute on the datetime instance. {% ifequal training.start_date.year training.end_date.year %} ... On Oct 30, 12:28 pm, Nicolas Steinmetz <[EMAIL PROTECTED]> wrote: > Hello, > > Issue : I would like to compare date at year level only. Idea is to > display the year o

Re: cursor.execute returns LONG

2007-10-30 Thread [EMAIL PROTECTED]
it returns a number type LONG but it schould not. 1. fetchall() and fetchrow() should do that 2. the query returns (in phpmyadmin) correct data which is few rows not a simgle number. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: MacOS X Leopard + mod_pyton + mysql problems

2007-10-30 Thread Joseph Heck
Hey Chris, How did you install the MySQL/Python library? Did you use MacPorts? A pre-made binary? On 10/30/07, crudolph <[EMAIL PROTECTED]> wrote: > > Hi, > > I was able to get django/python running via mod_python under the > apache2 installation under Leopard (MacOS X 10.5). However once I > st

Comparing date

2007-10-30 Thread Nicolas Steinmetz
Hello, Issue : I would like to compare date at year level only. Idea is to display the year only once if the two date are within the same year. I have the following model : class Training(models.Model): who = models.ForeignKey(User, verbose_name='Person') title = models.CharField('Na

Re: using newforms, an uncommon case.

2007-10-30 Thread Marty Alchin
On 10/30/07, Milan Andric <[EMAIL PROTECTED]> wrote: > I'm writing an application form (allow people to apply for a workshop) > and we allow the applicant to submit unfinished applications because > they can return to complete them at a later date. So most of the > model fields are blank=True.

using newforms, an uncommon case.

2007-10-30 Thread Milan Andric
Hi, I'm writing an application form (allow people to apply for a workshop) and we allow the applicant to submit unfinished applications because they can return to complete them at a later date. So most of the model fields are blank=True. Most of the fields are not required for a save() but i'd

Searching the Database

2007-10-30 Thread jacoberg2
Hey, I have been looking through the discussions and I have seen several different methods of indexing and searching. I was wondering what the best way might be to create a search engine for my django site that allows the user to enter different boolean operators and wildcard operators into th

Re: why is this happening?

2007-10-30 Thread Marty Alchin
On 10/30/07, Gigs_ <[EMAIL PROTECTED]> wrote: > > error: > IntegrityError at /accounts/register/ > accounts_playersprofile.first_name may not be NULL > Request Method: POST > Request URL:http://localhost:8000/accounts/register/ > Exception Type: IntegrityError > Exception Value

Re: the old django-in-a-subdirectory problem

2007-10-30 Thread tomris
http://www.cnd-industry.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EM

MacOS X Leopard + mod_pyton + mysql problems

2007-10-30 Thread crudolph
Hi, I was able to get django/python running via mod_python under the apache2 installation under Leopard (MacOS X 10.5). However once I start to add database support to my project - I get the following error. ImproperlyConfigured: Error loading MySQLdb module: dlopen(/tmp/ egg_cache/MySQL_python-

Re: the old django-in-a-subdirectory problem

2007-10-30 Thread Kenneth Gonsalves
On 30-Oct-07, at 7:45 PM, [EMAIL PROTECTED] wrote: > I've tried adding r'^django/' at the front of the urls in my url > config, but that just results in none of the urls matching. i normally use http://mysite/web/ , so admin would be: mysite/web/ admin/, all I do is add r'^web/' in front of my

Re: Problem with memcached after many hits

2007-10-30 Thread web-junkie
After further investigation I saw that memcached connections kept adding up, until they reached the limit. From that point it got slow and DB load jumped up. An Apache reload made everything fast again. After googling for memcached connections or so, I found http://groups.google.com/group/django-d

Re: Scaling architecture question: separate media server

2007-10-30 Thread Jökull
Maybe a SFTP mount or some sort of rsync will suffice? On Oct 29, 4:18 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > On 10/29/07, Jökull <[EMAIL PROTECTED]> wrote: > > > There is a lively discussion on an interesting upcoming feature of > > Django called FileStorage. This will allow any sort of

why is this happening?

2007-10-30 Thread Gigs_
error: IntegrityError at /accounts/register/ accounts_playersprofile.first_name may not be NULL Request Method: POST Request URL:http://localhost:8000/accounts/register/ Exception Type: IntegrityError Exception Value:accounts_playersprofile.first_name may not be NULL Ex

the old django-in-a-subdirectory problem

2007-10-30 Thread girzel
This issue has come up for many people in many places, but most of the threads seem old, and none of the solutions proposed has helped. I have a django installation in a subdirectory of a site, like so: www.mysite.com/django. At first I noticed a problem with the admin login, like other people ha

Re: Caching, sidebar, oh my...

2007-10-30 Thread Marty Alchin
On 10/30/07, Roodie <[EMAIL PROTECTED]> wrote: > I am working on a small portal, and there is a sidebar which is > visible on every page. It contains the list of latest news and forum > topics - the "usual" portal stuff. > Now the question is - how do you do that effectively in Django? I am > refe

Re: Caching, sidebar, oh my...

2007-10-30 Thread tomris
http://www.cnd-industry.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EM

[no subject]

2007-10-30 Thread Warner Leijenaar
-- Warner Leijenaar --- [EMAIL PROTECTED] [EMAIL PROTECTED] [w] http://renraw.nl/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Caching, sidebar, oh my...

2007-10-30 Thread Roodie
Hello, I am working on a small portal, and there is a sidebar which is visible on every page. It contains the list of latest news and forum topics - the "usual" portal stuff. Now the question is - how do you do that effectively in Django? I am referring to the part which gets the data from

lookup spanning apps

2007-10-30 Thread Wiley
I've run into a problem with a lookup that follows a long long chain of foreign key relationships spanning two apps (two groups of database tables with different app label prefixes)... the error is: table name "a_long__list__of__relationships__that__eventually__gets__cut_off..." specified more th

Re: initial data 'manage.py' question

2007-10-30 Thread Russell Keith-Magee
On 10/30/07, cjl <[EMAIL PROTECTED]> wrote: > > If I then add additional data to 'account.sql', is there a way to re- > load this updated initial data? Not through manage.py. You could always just pipe account.sql into your sql prompt - essentially, that's all Django is doing anyway. > Should I

Re: user registration problem

2007-10-30 Thread Gigs_
thanks On Oct 30, 1:59 pm, Matthias Kestenholz <[EMAIL PROTECTED]> wrote: > On 30.10.2007, at 13:38, Gigs_ wrote: > > > > > im getting this error all the time. > > > IntegrityError at /accounts/register/ > > column username is not unique > > Request Method:POST > > Request URL: http://lo

Re: user registration problem

2007-10-30 Thread Gigs_
its working now. On Oct 30, 1:59 pm, Matthias Kestenholz <[EMAIL PROTECTED]> wrote: > On 30.10.2007, at 13:38, Gigs_ wrote: > > > > > im getting this error all the time. > > > IntegrityError at /accounts/register/ > > column username is not unique > > Request Method:POST > > Request URL:

Re: user registration problem

2007-10-30 Thread Gigs_
that username is not taken. On Oct 30, 1:59 pm, Matthias Kestenholz <[EMAIL PROTECTED]> wrote: > On 30.10.2007, at 13:38, Gigs_ wrote: > > > > > im getting this error all the time. > > > IntegrityError at /accounts/register/ > > column username is not unique > > Request Method:POST > > Reques

initial data 'manage.py' question

2007-10-30 Thread cjl
I have a project named 'checkbook' with a single application named 'ledger', using sqlite3 for a database. The ledger application has two models, 'account' and 'transaction'. In the ledger subdirectory I have a directory named 'sql', which contains a file named 'account.sql'. When I run 'python

Re: user registration problem

2007-10-30 Thread Matthias Kestenholz
On 30.10.2007, at 13:38, Gigs_ wrote: > > im getting this error all the time. > > IntegrityError at /accounts/register/ > column username is not unique > Request Method: POST > Request URL: http://localhost:8000/accounts/register/ > Exception Type: IntegrityError > Exception Value:

  1   2   >