Re: urls.py and default values...

2012-10-21 Thread Tomas Ehrlich
Hello, you need to make 'year' argument optional: def student_reports(request, year=None): year = year or datetime.date.today().year ... Another option could be passing extra option to you view function:

urls.py and default values...

2012-10-21 Thread Lachlan Musicman
Hola, I have data across multiple years. I want to run reports on a per year basis, so I have in my urls: url(r'^students/reports/(?P\d{4})/$', student_reports, name='student_reports'), etc. What I want to know though, is how to have this in the urls: url(r'^students/reports/$',

Profiling tools?

2012-10-21 Thread zweb
I am using Django 1.3.1 I want to know in my application how much time is taken by a) database access b) creation of XML c) other parts of code. What would be some good tools to profile my application? The code to be profiled is in django view and uses Django ORM and Python 2.6 and lxml to

Re: how to use a customized logging formatter class

2012-10-21 Thread czamb...@gmail.com
As it happens I was looking into this yesterday because my request object includes a couple of attributes that I would like to see listed in the string representation of the request object. Your LOGGING settings needs to have a fomatter entry that looks something like: 'formatters': {

Re: 'User' object has no attribute 'message_set'

2012-10-21 Thread Russell Keith-Magee
Hi, It looks like something in filebrowser hasn't been updated to support Django 1.4. The message_set attribute was marked as deprecated in Django 1.2, and removed completely in Django 1.4. Instead of calling message_set, code should be calling the new contrib.messages API. Yours, Russ Magee

'User' object has no attribute 'message_set'

2012-10-21 Thread Руслан Янбердин
AttributeError at /admin/filebrowser/browse/ 'User' object has no attribute 'message_set' /usr/local/lib/python2.7/dist-packages/filebrowser/views.py in browse 1. request.user.message_set.create(message=msg) installed: Django 1.4.1, drappelli, filebrowser. Help me

querying data from Django userena profile.

2012-10-21 Thread Subhodip Biswas
Hi all, I have defined my custom signupform as shown here. http://docs.django-userena.org/en/latest/faq.html I now want to query my custom defined profile as shown above and retrieve a data(first_name) while the user is signed in. Once he signs out that data is flushed out. I see that with User

Re: Geometry vs Geography Data Type for PostGIS PostgreSQL database

2012-10-21 Thread Maarten Japink
I would use geography. You never know from where the user is coming, so you don't know the limitations of the projection. If you need extra functionality you can always transform to the most appropriate projection. 2012/10/21 JJ Zolper > Hello, > > So I've been

Re: Having LiveServerTestCase use same database as tests

2012-10-21 Thread Phil Gyford
No, I'm afraid not. I didn't get any replies (nor to a StackOverflow question http://stackoverflow.com/q/12041315/250962 ) and haven't gone back to try again. I'd tried everything I could think of already. Good luck, and let us know if you get anywhere! -- Forwarded message --

Re: New tutorial added to Django by Example

2012-10-21 Thread go scholarship
Hi, thanks for reply, actually, i try to built a reminder application, a person who logged in this apps, automatically set the user it self in ordered_by field, without needing to set ordered_by field manually. class Reminder(models.Model): domain_name = models.CharField(max_length=40)

Re: Having LiveServerTestCase use same database as tests

2012-10-21 Thread Дмитрий Белавенцев
Hi, Phil! I faced the same problem. Do you find the solution? вторник, 21 августа 2012 г., 22:24:59 UTC+7 пользователь Phil Gyford написал: > > I'm writing integration tests using LiveServerTestCase/Selenium in > v1.4.1. By default the process that's started by LiveServerTestCase > uses a