Ajax and non-ajax forms.

2009-05-06 Thread Chris Dew
eveloped a Django extension which makes this easier - some form of 'unajax for non javascript-capable browsers'. I realise that I'll probably need to do this myself, by hand, but I thought I'd ask the question, just in case. Thanks, Chris. --~--~-~--~~

Trouble Starting Up with runserver

2009-05-07 Thread Chris DPS
I am new to Django. When I try to execute: python manage.py runserver, I get the following error Error: [Errno 10104] getaddrinfo failed What is going on and what should I do? I have tried with 0.0.0.0:8000. I am running Django Version 1.0.2-final and Python 2.6 --~--~-~--~~-

Re: Ajax and non-ajax forms.

2009-05-07 Thread Chris Dew
Thanks for the advice, that's very useful. Do other developers consider it vital to support non-javascript browsers for accessibility reasons? Or are people largely using ajax regardless of accessibility, to make their apps look shiny? Regards, Chris. On 6 May, 16:07, Matthias Keste

Re: Trouble Starting Up with runserver

2009-05-07 Thread Chris DPS
On May 7, 11:23 am, Phil Mocek wrote: > On Thu, May 07, 2009 at 12:49:28PM -0500, Tim Chase wrote: > > > was searching for "interface" or "IP address" but the tutorial > > > says -- incorrectly or colloqially, depending on how you see > > > things -- "So to listen on all public IPs (useful if y

Trouble Starting Up with runserver

2009-05-08 Thread Chris DPS
I am new to Django. When I try to execute: python manage.py runserver, I get the following error Error: [Errno 10104] getaddrinfo failed What is going on and what should I do? I am running Django Version 1.0.2-final and Python 2.6 --~--~-~--~~~---~--~~ You recei

Re: Trouble Starting Up with runserver

2009-05-10 Thread Chris DPS
which firewall I'm using and shut it off. ---Chris DPS On May 8, 8:10 pm, Addy Yeow wrote: > Do you have firewall running?It could be blocking incoming local connection > to port 8000. > > - Addy > > On Sat, May 9, 2009 at 7:01 AM, Chris DPS wrote: > > > I am new

Re: Trouble Starting Up with runserver

2009-05-10 Thread Chris DPS
So I've definitely shut off all Firewalls. It still is having the same problem. HELP!!! PLEASE On May 10, 6:37 pm, Chris DPS wrote: > How to tell if I have a Firewall running? > I have turned off Windows firewall. When I go to the Windows Security > Center, the Firewall option i

Re: Trouble Starting Up with runserver

2009-05-10 Thread Chris DPS
r 127.0.0.1:8000'? Or 'python manage.py runserver :8000' > > - Addy > > On Mon, May 11, 2009 at 12:40 PM, Chris DPS wrote: > > > So I've definitely shut off all Firewalls. > > It still is having the same problem. > > > HELP!!! PLEASE > > >

Trouble starting up runserver

2009-05-12 Thread Chris DPS
I am new to Django. When I try to execute: python manage.py runserver, I get the following error Error: [Errno 10104] getaddrinfo failed What is going on and what should I do? I am running Django Version 1.0.2-final and Python 2.6 I have turned off all Firewalls. ping to localhost in the cmd

Re: parsing data from fileupload

2009-05-18 Thread Chris Shenton
On May 18, 2009, at 12:12 PM, Patrick wrote: > > Well, I guess what I'm confused about is adding data that doesn't come > directly from forms. > I ended up doing this and it seemed to work. > > for line in file: >b=Book() >b.title=line >b.save() Here is how I do it, Model, Form, Vie

Re: parsing data from fileupload

2009-05-18 Thread Chris Shenton
Oh, make sure your upload form specifies the 'enctype' attribute so it will actually send a file object, like: {% block content %} Upload a file... {{ form.as_p }} {% endblock %} --~--~-~--~~~---~--~~ You received this message because you are subscribed t

Re: help on outlook integration

2009-05-19 Thread Chris Withers
we are > able to access only outlook’s data. We are expecting header cookie and > response data from inbox page of outlook. I don't really understand how posting the same vague requirements once every 10-15 minutes is supposed to help other than by annoying everyone on this lis

Re: perfomance question

2009-05-21 Thread Chris Withers
Rodrigo Aliste P. wrote: > OH! It does it alone! Another awesome thing to my awesomeness list of > django. What was your solution in the end? I'm always interested this kind of batching of results, and I'm very new to Django... Chris -- Simplistix - Content Managemen

Re: Installing django

2009-05-21 Thread Chris Lawlor
Just to see what all the fuss is about, most of that video is the guy configuring his particular application. The actual Django install is very straightforward. On May 21, 1:53 am, Kenneth Gonsalves wrote: > On Thursday 21 May 2009 11:15:29 LeonTheCleaner wrote: > > > @sdc, yeah I plan to try we

Re: Single sign-in

2009-05-23 Thread Chris McCormick
er systems. There's a chance that I might be able to convince my client to let me do this work on a paid basis - will report back here if and when I get this off the ground. Best, Chris. On Fri, May 22, 2009 at 11:57:59AM -0700, Lakshman wrote: > > Hi, > > I now have this exac

runserver fails

2009-05-24 Thread Chris DPS
When I execute runserver, I get the following message: Validating models... 0 errors found Django version 1.0.2 final, using settings 'mysite.settings' Development server is running at http://127.0.0.1:8000/ Quit the server with CTRL-BREAK. Error: [Errno 10104] getaddrinfo failed And the server

Re: runserver fails

2009-05-24 Thread Chris DPS
gt; -- dz > > On Sun, May 24, 2009 at 10:59 PM, Chris DPS wrote: > > > When I execute runserver, I get the following message: > > > Validating models... > > 0 errors found > > > Django version 1.0.2 final, using settings 'mysite.settings' > >

Re: Obfuscate HTML..?

2009-05-25 Thread Chris Czub
What reason do you have for this? Security through obfuscation isn't a good strategy, especially with something as intrinsically open as HTML. If your site can be hacked just by being able to view the HTML then you have bigger problems to worry about than obfuscating it. On Mon, May 25, 2009 at 4

Re: Drill down combo boxes (Country, State, City)

2009-05-31 Thread Chris Moffitt
You want a chained select form & will need to use javascript to do it. I prefer jquery and have used the one here - http://www.codeassembly.com/Simple-chained-combobox-plugin-for-jQuery/ The code demos are for PHP but it's simple enough to apply to Django. -Chris On Sun, May 31, 2009

Re: Logging to Database while using @transaction.commit_manually decorator

2009-06-07 Thread Chris Stoyles
ecute an insert statement via the database cursor the transaction management will still take place, is this correct? Cheers, Chris On Mon, Jun 8, 2009 at 8:11 AM, Karen Tracey wrote: > On Sun, Jun 7, 2009 at 7:44 PM, ChrisStoyles wrote: > >> >> Hi All, >> >> I just

Re: Logging to Database while using @transaction.commit_manually decorator

2009-06-08 Thread Chris Stoyles
fails (again, except for any logging that has been done). The view contains a big try/except statement and the rollback is in the "except" part. I may have to approach this a different way, because it doesn't look like I can easily do a fine-grained commit. Cheers, Chris On Mon, J

Re: Problems with view... not sure how to get the data to my template

2009-06-08 Thread Chris Stoyles
7;t execute. Are all the calls you make to net.append() supposed to be myrange.append() instead? Chris On Mon, Jun 8, 2009 at 11:46 AM, Mitch Anderson wrote: > > Below is what I have currently... it currently displays the numbers in > the range its supposed to, but tying the products

Bloxsom in Django

2009-06-09 Thread Chris McCormick
PyBloxsom developers, and thanks for their software which gave me a year of good service!). <http://mccormick.cx/news/entries/django-bloxsom> Best, Chris. --- http://mccormick.cx --~--~-~--~~~---~--~~ You received this message because y

Re: Logging to Database while using @transaction.commit_manually decorator

2009-06-09 Thread Chris Stoyles
The only log entries I want committed are the ones that tell me why a roll-back occurred. What you've said below sounds like a good enough solution, thanks for all your input. Cheers, Chris On Mon, Jun 8, 2009 at 11:38 PM, Karen Tracey wrote: > On Mon, Jun 8, 2009 at 5:39 AM, Chris

Django and CSS

2009-06-18 Thread Chris DPS
Hi, I'm new to Django. I've read the doc: http://docs.djangoproject.com/en/dev/howto/static-files/?from=olddocs which is about static files but still do not quite understand what to call everything and it isn't working On my development machine, I want to use this hack and not deal with other se

Re: Should this be its own app?

2009-06-19 Thread Chris Withers
e a separate project somewhere in your system path so that > all your projects can use it. Over engineering at the start is usually > counter > productive. Interesting, I'm pretty sure I remember Jacob saying almost the exact opposite in his Django tutorial at PyCon... Chris

Re: PyFacebook and python-twitter

2009-09-13 Thread Chris Babcock
there will be no problems with those specific libraries. Asking customer service about support for such will only confuse them because it's an application level that's completely irrelevant to their service. Chris Babcock signature.asc Description: PGP signature

djangorecipe questions

2009-09-16 Thread Chris Withers
s it common practice to have two djangorecipe sections, once for development and one for production, or is it more common to have a buildout.cfg and dev.cfg, with dev.cfg extending buildout.cfg? Finally, it's a shame that the projects generated by the project option are not eggs

Re: Multiple implementations of django's authentication/authorization system

2009-09-16 Thread Chris Babcock
nister the site from 'wasting time' performing non-administrative functions. Hiding presence information for admins and/or creating an adminstrative class that doesn't have access to site features is better design and likely easier to implement. Chris Babcock signature.asc Description: PGP signature

Re: djangorecipe questions

2009-09-17 Thread Chris Withers
an do, but don't hold your breath ;-) (I'm currently following http://jacobian.org/writing/django-apps-with-buildout/ and on a bit of a tight deadline, so don't know when I'll be able to get to this) cheers, Chris -- Simplistix - Content Management, Batch Processing & P

Re: djangorecipe questions

2009-09-17 Thread Chris Withers
James Bennett wrote: > On Thu, Sep 17, 2009 at 5:23 AM, Chris Withers wrote: >> Well, I'm certainly not setuptools-happy, but Django appears to be >> wrapped up as a standard distribution on PyPI (sorry, should have said >> distro, not egg), so it would make sense to u

where to put tests?

2009-09-17 Thread Chris Withers
ython testing frameworks? cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Djang

Re: where to put tests?

2009-09-17 Thread Chris Withers
them if you have a suite() function in the __init__ of your tests that returns all yours tests, which is a little bit limiting compared to other python test runners... Chris -- Simplistix - Content Management, Batch Processing & Python Consulting

Re: djangorecipe questions

2009-09-18 Thread Chris Withers
James Bennett wrote: > On Thu, Sep 17, 2009 at 6:01 AM, Chris Withers wrote: >> All of your problems seem to center on zipped eggs. These are evil >> things anyway, and can be avoided by simply putting zip_safe=False as a >> parameter to setuptools (whether it actually come

Editable sitemap priority

2009-09-20 Thread Chris Moffitt
would, I'd be interested in learning. Thanks for any input, Chris --~--~-~--~~~---~--~~ 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.

IndexError: list index out of range

2009-09-21 Thread Chris McComas
I am trying to write to CSV, I was able to do so before, not sure what the problem is... When my query returns results, I get this error http://dpaste.com/96399/ Here's my view http://dpaste.com/96398/ If the query is empty it opens the CSV with only the header row... What am I doing wrong? --

composite primary keys?

2009-09-22 Thread Chris Withers
n(DateTime,index=True) cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dja

specifying test-only dependencies with djangorecipe

2009-09-22 Thread Chris Withers
s? cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" grou

serialization formats?

2009-09-23 Thread Chris Withers
Hi All, Where can I find docs on the actual serialisation formats used by Django's serialisation support? http://docs.djangoproject.com/en/dev/topics/serialization/#id1 ...lists them, but doesn't actually describe them :-S cheers, Chris -- Simplistix - Content Management, Batch

equivalent of getattr in a django template

2009-09-23 Thread Chris Withers
{% endfor %} What do I put in the marked spot to be the equivalent of getattr(object,name)? cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk --~--~-~--~~~---~--~~ You receive

Re: equivalent of getattr in a django template

2009-09-23 Thread Chris Withers
Maksymus007 wrote: > {{object.name}} ? no, that is the equivalent of: getattr(object,'name') I want: getattr(object,name) Subtle, but rather important, difference... Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www

Re: equivalent of getattr in a django template

2009-09-23 Thread Chris Withers
return getattr(obj, val) > > Now in the template: > > {{ object|getattr:name }} I agree that it doesn't belong in the template language, but it's surprising that there's no standard filter to do this... Is there an open issue for this or should I raise one? Chris

re-using field definitions

2009-09-24 Thread Chris Withers
was to randomise the order of the fields in the admin interface :-( How should I re-use field definitions so I'm not violating DRY but also such that field ordering stays consistent? cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting

is this a sane way to show total number of objects in pagination?

2009-09-24 Thread Chris Withers
) Is that the best way to get the total number of objects returned or is there a way I can do that which means the database does as little work as possible? cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.si

Re: is this a sane way to show total number of objects in pagination?

2009-09-24 Thread Chris Withers
Chris Withers wrote: > objects = model.objects.all() > paginator = Paginator(objects,10) > return render_to_response( > 'index.html',dict( > objects = paginator.page(page), > total_objects = len(objects), >

Re: is this a sane way to show total number of objects in pagination?

2009-09-24 Thread Chris Withers
Brian McKeever wrote: > .count is definitely the way to go. Although, I would probably pass it > to your template instead of determining it there. What difference does it make? Chris -- Simplistix - Content Management, Batch Processing & Python Consulting

Re: re-using field definitions

2009-09-24 Thread Chris Withers
artials rock :-) (I could also set all the common bits in the partial and only have the bits that are different in the field definition - DRY to the max :-P) Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk --~--~---

Re: is this a sane way to show total number of objects in pagination?

2009-09-25 Thread Chris Withers
Jani Tiainen wrote: > Chris Withers kirjoitti: >> Brian McKeever wrote: >>> .count is definitely the way to go. Although, I would probably pass it >>> to your template instead of determining it there. >> What difference does it make? > > len(qs) evalu

Re: Is Django thread safe?

2009-09-28 Thread Chris Withers
Pythoni wrote: > Is Django thread safe?If so, from which version? > Thanks for reply The answer is most likely "no, but it doesn't matter". Why are you asking? Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - ht

Re: developing and deploying django with zc.buildout

2009-09-30 Thread Chris Withers
your code is really ending up on the python path. cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk --~--~-~--~~~---~--~~ You received this message because you are subscribed to th

Re: Is Django thread safe?

2009-09-30 Thread Chris Withers
better help on the mod_wsgi list: http://googlegroups.com/group/modwsgi Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk --~--~-~--~~~---~--~~ You received this message because you are

Switching from MySQL to PostgreSQL

2009-10-06 Thread Chris McComas
want to switch from MySQL to PostgreSQL. Is there an easy way for us to take all of our data from our MySQL and move it over to PostgreSQL? Chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

bulk import limits?

2009-10-08 Thread Chris Withers
it I'll need to chunk the data up into reasonable-sized xml files. My questions is: what limits the size of the xml file that can be imported with djangoadmin's loaddata command? What would people recommend as a maximum size of xml file to use with this command? cheers, Chris --

efficiently deleting content based on how old it is

2009-10-08 Thread Chris Withers
ed services and those services associated pages? (in this app, there could be about 3 million pages that are associated with each month though a bunch of service objects) cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://w

Re: iphone to website

2009-10-08 Thread Chris Withers
grant neale wrote: > Does anyone have a hint on where I should start, re: making the > website ready to receive this information? Doesn't the iPhone have a web browser? Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.s

Re: efficiently deleting content based on how old it is

2009-10-08 Thread Chris Withers
hange, so I'd like to do this through the Django ORM. Does the Django ORM have a sql abstraction layer like sqlalchemy where I can do the kind of thing you're proposing, or do I need to work with models? cheers, Chris -- Simplistix - Content

problems subclassing models

2009-10-08 Thread Chris Withers
odels subclass that. However, as soon as I did this, I started getting bizarre SQL errors, things like: ProgrammingError at /some/path relation "myapp_urlmodel" does not exist LINE 1: ...somefield1"."somefield2" FROM "myapp_modelname" INNER JOIN "myapp_urlm...

Templating wart

2009-10-09 Thread Chris Withers
s such that I don't have to repeat the condition? DRY and all that... Chris --~--~-~--~~~---~--~~ 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@googl

Re: efficiently deleting content based on how old it is

2009-10-09 Thread Chris Withers
e over the month names more than 6 back from the > current position and delete the records. I'm keen to use "real dates" as Tim suggested. Perhaps just using the 1st day in each month as the "month"? Chris --~--~-~--~~~---~--~~ You recei

Re: problems subclassing models

2009-10-09 Thread Chris Withers
Daniel Roseman wrote: > If your base model doesn't contain any fields, you should probably > mark it as abstract. > http://docs.djangoproject.com/en/dev/topics/db/models/#id6 Thanks, knew there'd be some magic I needed t

Re: Templating wart

2009-10-09 Thread Chris Withers
british.assassin wrote: > You could do this: > > > {% for cell in row %} > > {% if forloop.first and row.url %}{{cell}} > {% else %} > {{cell}} > {% endif %} Then you're violating DRY on {{cell}}, which of course may be a lot mroe complicated than {{cell}}...

required fields during object instantiation

2009-10-10 Thread Chris Withers
all last): File "models.py", line 65, in __unicode__ return unicode(self.month.strftime('%B %Y')) AttributeError: 'NoneType' object has no attribute 'strftime' :-( Chris -- Simplistix - Content Management,

Re: newbie , need some help

2009-10-10 Thread Chris Withers
he Django book while you're at it? ;-) Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

Re: Current Django tests fail?

2009-10-12 Thread Chris Withers
Tim Chase wrote: > Is there something obvious I missed? Hi Tim, I do wonder if you might get more help with these problems on the Django developers list? cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplisti

Re: any open source complete django app to use as start

2009-10-12 Thread Chris Moffitt
Might as well pile on with Satchmo: http://www.satchmoproject.com -Chris On Mon, Oct 12, 2009 at 10:52 AM, Ben Rousch wrote: > > On Mon, Oct 12, 2009 at 11:50 AM, Daniel Hilton > wrote: > > > > 2009/10/12 shreko : > >> > >> I've been looking all

does this get or create code ship with django?

2009-10-14 Thread Chris Withers
Hi All, I have a function that looks like: def get_or_create(model,**kw): try: obj = model.objects.get(**kw) except model.DoesNotExist: obj = model(**kw) return model Does something like this ship with django? If not, should it? cheers, Chris -- Simplistix

hosting from /some/url in apache

2009-10-14 Thread Chris Withers
/some/folder ...gives me a 404 unless I do, I'm not hopeful. What am I doing wrong? Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk --~--~-~--~~~---~--~~ You received this message be

Re: hosting from /some/url in apache

2009-10-14 Thread Chris Withers
our app you must provided full > absolutely URL to login page, I've done it settings.py: > > LOGIN_URL='//login/' Surely this should respect SCRIPT_NAME just the same as everything else? Chris -- Simplistix - Content Management, Batch Processing & P

Re: efficiently deleting content based on how old it is

2009-10-20 Thread Chris Withers
buttman wrote: > you could also do it this way: > > http://pythonblog300246943.blogspot.com/2009/09/cron-jobs-with-django-made-easy.html url whacking like that is pretty evil... Chris -- Simplistix - Content Management, Batch Processing & Python Consulting

Re: efficiently deleting content based on how old it is

2009-10-20 Thread Chris Withers
o an > objects.filter(), Well, cascading deletes do happen automatically with Django, so no problem there... cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk --~--~-~--~~~---~--~

ANN - Satchmo 0.9 Released

2009-10-25 Thread Chris Moffitt
ttp://www.satchmoproject.com/docs/svn/quickstart.html Thank you to everyone that has contributed to Satchmo and I look forward to finalizing a 1.0 release. -Chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Djan

Unit testing form validation issue

2009-10-26 Thread Chris Allen
a the debugger. Using a data dict instead of the actual request object. the is_valid() fails for two different forms on three fields (1 for one, 2 for the other). All three fields are choice fields. Dump of various relevant info is below. I appreciate any help anyone can offer. Thanks for your time,

Re: efficiently deleting content based on how old it is

2009-10-27 Thread Chris Withers
st. The legacy database was ZODB, which was the problem. The data took up about 14GB on disk in ZODB. About 1GB in Postgres Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk --~--~-~--~~~-

Re: Unit testing form validation issue

2009-10-27 Thread Chris Allen
Ended up populating the test database with fixtures via .json dumps. Thank you very much for your help. --- Chris On Oct 26, 6:19 pm, Karen Tracey wrote: > On Mon, Oct 26, 2009 at 4:12 PM, Chris Allen wrote: > > > Anyone have any experience with forms (ModelMultipleChoic

Re: Remote developer opportunity

2009-11-02 Thread Chris Withers
the way it sets the Reply-To header to the list address... Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk --~--~-~--~~~---~--~~ You received this message because you are subscribed to t

why deliver .csv when you want to be delivering .xls?

2009-11-03 Thread Chris Withers
). ...or you could just use xlwt and deliver the real deal ;-) http://www.python-excel.org/ That said, I'd be surprised if the templating is the problem here, it'll be the interaction with the database that's taking the time... Chris -- Simplistix - Content Management, Batc

Django and Authorize.net

2009-12-02 Thread Chris McComas
I was curious if anyone had done any one-off payments with Django/ authorize.net, or if there were and pluggable apps out there (I know Satchmo, that's my backup plan). Thanks, Chris -- You received this message because you are subscribed to the Google Groups "Django users" gr

Re: Django and Authorize.net

2009-12-02 Thread Chris Moffitt
/labs -Chris On Wed, Dec 2, 2009 at 7:17 AM, Chris McComas wrote: > Greetings, > > We have an application for our school online, just recently the > university controller and business office finally gave us clearance to > accept our application fee online, and they setup an account

Re: How to show site down for maintenance page

2009-12-05 Thread Chris Moffitt
Try this - http://code.google.com/p/django-maintenancemode/ -Chris On Sat, Dec 5, 2009 at 6:54 PM, zweb wrote: > What is the best way to show site down for maintenance page ? > > -- > > You received this message because you are subscribed to the Google Groups > "Django

Re: Format fields in list, but keep sortable?

2009-12-08 Thread Chris Lawlor
You could add a field to store the calculated size, and override the model's save method to perform the necessary calculation. Something like: def save(self, force_insert=False, force_update=False): self.size_formatted = self.width * self.height // or whatever your calculation actually is

TemplateSyntaxError: 'property' object is not iterable

2009-12-17 Thread Chris Curvey
I have my class definition that looks like class Foo: def get_bars(self): bars = [] # do something to collect bar instances return bars bars = property(get_bars) in my template, I'd like to do something like this: {% for bar in foo.bars %} {{bar.snafu}} {% endfor %}

Re: TemplateSyntaxError: 'property' object is not iterable

2009-12-18 Thread Chris Curvey
Never mind. Me am a moron. Had a totally different programming error elsewhere. It works as is it should. On Dec 17, 4:12 pm, Chris Curvey wrote: > I have my class definition that looks like > > class Foo: >    def get_bars(self): >       bars = [] >        # do someth

admin interface, foreign keys and subclasses

2009-12-23 Thread Chris Curvey
this may be beyond the current abilities of the Django auto-generated admin interface, but I thought I'd ask... I have a class called "Customer" which has a one-to-many relationship with "ServiceRequest". I've got that all working through the admin interface and it's working fine, like this: cla

Re: newbie problem -- cant import library

2010-04-30 Thread Chris Czub
Are you running that command from the interactive shell invoked by running 'python manage.py shell'? Invoking the interactive shell that way should set up all your python library settings properly for your Django app. On Apr 30, 2010, at 5:44 PM, Mark Serva wrote: I am running django 1.

Re: newbie problem -- cant import library

2010-04-30 Thread Chris Czub
Oh... Actually looking at the error that was spit out, it looks like you made a typo. Your error says you typed 'from mysite.blog import BlogPost'. On Apr 30, 2010, at 5:44 PM, Mark Serva wrote: from mysite.blog import BlogPost -- You received this message because you are subscribed to

where can I find good unit test examples?

2010-05-06 Thread Chris Withers
Hi All, Where can I find good examples of django unit tests? I currently just want to test my models and some helper functions, but they will do a .save() on a bunch of model instances. Any help gratefully recieved! Chris -- You received this message because you are subscribed to the

customizing emailed error messages

2010-05-06 Thread Chris Curvey
When I get an unexpected error in my mod_wsgi/Django application, I'm emailed a very nice error message with a stack trace and all the HTTP environment variables (GET, POST, META, etc.) That's great, but it does not include the name of the logged-in user. Is there a way for me to add that informat

Re: Hi guys, compatibility issues between django 1.1.1, satchmo 0.9 and postgresql 8.4?

2010-05-11 Thread Chris Moffitt
Rafael, You should probably direct your question to the satchmo-user's list to get more responses. I'm not aware of any Postgresql specific issues so if you can provide more details on the satchmo list, we'll try to help. -Chris On Tue, May 11, 2010 at 5:35 PM, Rafael Pineda wr

Django reversion, AuditTrail, MySQL MyISAM

2010-05-20 Thread Chris Allen
mention of Django 1.2 compatibility. Django-audit-log appears to be abandoned. Is anyone aware of any functional alternatives or solutions to the blockers for using the above? Thank you for reading, :) --- Chris -- You received this message because you are subscribed to the Google Groups "Dj

more complex queries

2010-05-20 Thread Chris Withers
Hi All, I have a Transaction model with a DecimalField called "amount" and a CharField called "action". How do I sum all the transactions, multipling the amount by -1 when the action is REFUND? cheers, Chris -- Simplistix - Content Management, Batch Processing

Re: more complex queries

2010-05-20 Thread Chris Withers
... Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com.

filtering by related object causes query to grind to a halt

2010-05-23 Thread Chris Withers
I added the: queryset = queryset.filter(ticket__event=event) ...line, evaluating the queryset grinds to a halt. Why is that? How can I make it fast? cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk -- You received t

Re: filtering by related object causes query to grind to a halt

2010-05-23 Thread Chris Withers
Okay, so I noticed that it's the following code, and it's only when I filter on user *end* event: Chris Withers wrote: queryset = TicketStatus.objects.filter(active=True) if user_id: queryset = queryset.filter(owner=User.objects.get(id=user_id)) queryset = query

Re: slow filtering by related and local fields, only on sqlite, not on postgres?

2010-05-23 Thread Chris Withers
Chris Withers wrote: queryset = TicketStatus.objects.filter(active=True) if user_id: queryset = queryset.filter(owner=User.objects.get(id=user_id)) queryset = queryset.filter(ticket__event=event) return list_detail.object_list( request, queryset

mod_wsgi can't find app to import..but I added path to wsgi file?!

2010-05-25 Thread Chris Seberino
I can successfully run a toy WSGI app with my Apache/mod_wsgi set up. When I try to run my Django app with mod_wsgi it can't ever find the modules to load and Apache's error.log gives ImportError's. I tried adding paths to sys.path in the wsgi file. Not what else to try. cs -- You received th

Re: mod_wsgi can't find app to import..but I added path to wsgi file?!

2010-05-27 Thread Chris Seberino
/home/seb/MAIN/seoconquer/apache/ application.wsgi Order Allow,Deny Allow from All Any help still greatly appreciated as always. Chris -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: mod_wsgi can't find app to import..but I added path to wsgi file?!

2010-05-27 Thread Chris Seberino
I fixed the path issue that was causing the spinning but now I'm back to getting import errors even with __init__.py in my apache directory. Here is the exact error from Apache's error.log. ... [Thu May 27 10:18:18 2010] [error] [client 99.159.221.130] _default = translation(settings.LANGUAG

Re: mod_wsgi can't find app to import..but I added path to wsgi file?!

2010-05-27 Thread Chris Seberino
On May 27, 10:51 am, Nuno Maltez wrote: > > ImportError: No module named mvc > > What's the "mvc" module? Python can't seem to find it. Is it in your > python path? My project is called seoconquer. My app is called mvc. My absolute directory path to mvc is /home/seb/MAIN/seoconquer/mvc. I have /

Re: mod_wsgi can't find app to import..but I added path to wsgi file?!

2010-05-28 Thread Chris Seberino
On May 27, 6:56 pm, Graham Dumpleton wrote: > You also need to add '/home/seb/MAIN/seoconquer'. Read: > >  http://blog.dscpl.com.au/2010/03/improved-wsgi-script-for-use-with.html I tried both versions of the wsgi script on your blog. And I still get this same error. ImportError: No module na

Issues running Djano app as Apache's www-data user with mod_wsgi.

2010-06-06 Thread Chris Seberino
that group. Problem is that when I create **NEW** files they are NOT automatically added to this new group!??! Sound familiar? Chris -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@g

<    1   2   3   4   5   6   7   8   9   10   >