Re: (argh!!) Fwd: Undelivered Mail Returned to Sender

2011-10-04 Thread Cal Leeming [Simplicity Media Ltd]
Nice one - thank you for sorting this out Russell, was driving me a bit nuts! On Oct 5, 2011 1:26 AM, "Russell Keith-Magee" wrote: > On Wed, Oct 5, 2011 at 7:42 AM, Cal Leeming [Simplicity Media Ltd] > wrote: >> Argh - is anyone else from the list getting this same bounce mail all the >> time? I

Iteration over queryset in a model

2011-10-04 Thread eyscooby
new to django/python developement, can't get this one figured out. I have a model that has a couple DateFields (issued_date & completion_date), and I'm trying to return a value with the difference of the two on each entry that is complete, and then if it isn't completed yet, show the amount of day

Re: (argh!!) Fwd: Undelivered Mail Returned to Sender

2011-10-04 Thread Russell Keith-Magee
On Wed, Oct 5, 2011 at 7:42 AM, Cal Leeming [Simplicity Media Ltd] wrote: > Argh - is anyone else from the list getting this same bounce mail all the > time? I notified list admins but they couldnt find the relevant user. If you > are getting this, PLEASE +1. Thanks. Cal Hi Cal, I found the user

(argh!!) Fwd: Undelivered Mail Returned to Sender

2011-10-04 Thread Cal Leeming [Simplicity Media Ltd]
Argh - is anyone else from the list getting this same bounce mail all the time? I notified list admins but they couldnt find the relevant user. If you are getting this, PLEASE +1. Thanks. Cal -- Forwarded message -- From: "Mail Delivery System" Date: Oct 4, 2011 11:06 PM Subject: U

Re: Thread-safeness of templates

2011-10-04 Thread Martin J. Laubach
Are you sure your context is thread-safe, ie. it's rebuilt from scratch every time you render an email and not re-used, stored in a global variable, class variable, whatever? Your problem description very much sounds like someone is fiddling with the context while the template is rendering.

Re: can't get STATICFILES to work (Django dev version)

2011-10-04 Thread Asinox
Check this http://stackoverflow.com/questions/7650893/serving-static-files-on-my-own-server/7651021#7651021 On Oct 4, 4:14 am, Mike Dewhirst wrote: > On 3/10/2011 10:00pm, Gelonida N wrote: > > > On 09/26/2011 10:21 PM, nara wrote: > >> I am having trouble getting STATICFILES to work. I have re

test_invalid_key failing

2011-10-04 Thread Justin Holmes
I am having a problem with contrib.sessions.tests.test_valid_key (line 159). It's a mixin which in the failure case is mixed with CacheDBSessionTests. The test raises: "AttributeError: 'bool' object has no attribute 'get'" The error is actually raised by session.save() on 164. Stepping inward

Re: Randomly clearing database tables

2011-10-04 Thread msbuck
Below is the settings. I am fairly new to python unit testing so my understanding of things could be better. But right now, if I select Run As -> Python Unit Test will my project is selected, it runs all of my Django tests and clobbers my working db as a result. The test runner also appears to be i

Re: Django Admin generating thousands of useless SQL queries

2011-10-04 Thread Paulo VJ
Well, I found out that even those 70 ones are mostly repeated queries for another ForeignKeyField of the model. If I add another ForeignKey to be printed I get a whooping 43336 queries for showing 72 rows of data. The correct queries ones seems to be limited at 6, tho. -- You received this mess

Re: Randomly clearing database tables

2011-10-04 Thread Ian
On Oct 4, 10:30 am, msbuck wrote: > Good news! Yesterday, I was repeatedly starting the development server > from Eclipse which is on the Run As  -> menu which cascades to Run > Server or Run Python Unit Test. I must have accidently clicked that we > I really wanted to start my server. That comman

Django Admin generating thousands of useless SQL queries

2011-10-04 Thread Paulo VJ
Hello everyone, I'm building a simple application that uses only django.admin as it's interface, but I found out using two tables for the name of a single one bringing the number of SQL queries from 70 to 20.000. Am I doing this wrong? class Categoria(models.Model): categoria = models.CharFi

Bug in django.contrib.auth built in unit tests?

2011-10-04 Thread tobin
I'm using apache2 along with RemoteUserBackend as an AUTHENTICATION_BACKEND to pass in REMOTE_USER. When this is enabled the built in unit tests are failing [1]. Its obvious there are no users created and this fails, however should this be classified as a bug??? I haven't been able to find anything

Re: Display superscript or subscript in template site

2011-10-04 Thread Brian Bouterse
Even though it is off topic from Django, I would recommend taking some time to learn about unicode superscript and subscript symbols. Brian On Tue, Oct 4, 2011 at 12:11 PM, Khuong Lien wrote: > Hi All, > > > I want to display superscript or subscript t

Thread-safeness of templates

2011-10-04 Thread Francis Kung
Hi, My understanding is that Django is (or attempts to be) thread-safe, and I'm hoping someone can help me track down this problem: Part of my app uses django templates to create the content of an email, which it then sends out. The code is something like, email = 'a...@def.com' context = {'em

Display superscript or subscript in template site

2011-10-04 Thread Khuong Lien
Hi All, I want to display superscript or subscript to template site by using django .But i don't know how to do it. Please help .. Many 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@g

Re: Randomly clearing database tables

2011-10-04 Thread msbuck
Good news! Yesterday, I was repeatedly starting the development server from Eclipse which is on the Run As -> menu which cascades to Run Server or Run Python Unit Test. I must have accidently clicked that we I really wanted to start my server. That command runs the PyDev Test runner and that's wha

Re: suggestion for dependency injection in view tests

2011-10-04 Thread Stuart
Also, depending on your scenario, the classes might be overkill. You could just as easily pass in a callable. In that case your view would look something like this... def suggest(request, usrid=None, get_friends=__get_friends):     current_user = request.facebook.user     facebook_friends = get_fr

Re: Randomly clearing database tables

2011-10-04 Thread msbuck
I don't have an initial_data.* fixtures file although I do use one in my tests. This data was not loaded. I didn't run syncdb or flush (very certain of this). My current theory is that flush was somehow called from my code. I just wish I could figure out how. Thanks for the suggestion. On Oct 4,

Freelance Python/Django Developer

2011-10-04 Thread Farhan Ahmed
I'm looking for full time freelance Python/Django Developers to work from home on a long-term continuous project. Requirements: - Good Python and Django experience - Uses JavaScript/JQuery - Has decent CSS design skills - i.e. can finish/polish the HTML themselves - Feels comfortable in SQLite/MyS

Re: Randomly clearing database tables

2011-10-04 Thread John Handelaar
On 4 October 2011 15:11, msbuck wrote: > Twice now, I have had most of my django tables cleared from my > database including my app tables. Obviously I need to track this down. > In addition to the two tables created by my app, the AUTH_USER, > AUTH_USER_USER_PERMISSIONS and DJANGO_ADMIN_LOG are c

Re: Randomly clearing database tables

2011-10-04 Thread msbuck
I'll look at any theory right now :-). I'm using the standard django TestCase to write tests for my models, views, and forms. These are in separate modules in the app test directory where I have imported them into the __init__.py. My view tests do use a fixture to provide data for the app's two tab

Re: Randomly clearing database tables

2011-10-04 Thread Ilian Iliev
Hi, this sounds like a bad configuration of the tests database. Is it possible that your test are clearing your database? Have you made some special test configuration? -- eng. Ilian Iliev Web Software Developer Mobile: +359 88 66 08 400 Website: http://ilian.i-n-i.org On Tue, Oct 4, 2011 at 5

Django DynamicSites Framework Error

2011-10-04 Thread Michael Hawkins
I'm trying to get this Dynamic Multi-site framework ( https://bitbucket.org/uysrc/django-dynamicsites/src) up and running on Django 1.3.1, but I keep getting "Database Error: No such column django_site.folder_name" ... I've set up a site in the admin panel, run syncdb and I can't figure out why the

Re: suggestion for dependency injection in view tests

2011-10-04 Thread Stuart
Here is one approach... class FBFriends: def get_friends(self, current_user): return __get_friends(current_user) # heavy call def suggest(request, usrid=None, friend_source=FBFriends()): current_user = request.facebook.user facebook_friends = friend_source.get_friends(current_

Randomly clearing database tables

2011-10-04 Thread msbuck
Twice now, I have had most of my django tables cleared from my database including my app tables. Obviously I need to track this down. In addition to the two tables created by my app, the AUTH_USER, AUTH_USER_USER_PERMISSIONS and DJANGO_ADMIN_LOG are cleared. The AUTH_PERMISSION, DJANGO_CONTENT_TYPE

Re: howto disable label for field in admin app form?

2011-10-04 Thread Иван Иванов
На Tue, 4 Oct 2011 15:14:44 +0200 Aljoša Mohorović написа: > On Tue, Oct 4, 2011 at 2:46 PM, Ivan Ivanov > wrote: > > I think, this is exactly what you want. > > i need to do this on field level, not form. thanks for suggestion. > javascript works just fine in this case > Oh, I see. Yes, this

Re: loaddata and auto_now_add=True

2011-10-04 Thread Russell Keith-Magee
A fixture is intended to be a full and complete copy of what you want in the database, including *all* date/timestamps. If you want data to be created with creation/update times that reflect the time at which the test was executed, then you need to create that data in the setUp() method of your tes

Re: howto disable label for field in admin app form?

2011-10-04 Thread Aljoša Mohorović
On Tue, Oct 4, 2011 at 2:46 PM, Ivan Ivanov wrote: > I think, this is exactly what you want. i need to do this on field level, not form. thanks for suggestion. javascript works just fine in this case -- You received this message because you are subscribed to the Google Groups "Django users" gr

Cannot get django admin's inlines to work

2011-10-04 Thread sadik
I get has no ForeignKey to each time I try to edit Theater model. I saw multi-table-inheritance[1] approach but interesting in this one w/o inheritance. Could you bring an idea how to get Theater's form with Location model within it? Code looks like below: class Location(models.Model): lati

Re: howto disable label for field in admin app form?

2011-10-04 Thread Ivan Ivanov
Source: https://docs.djangoproject.com/en/dev/ref/forms/api/#configuring-html-label-tags If auto_id is False, then the form output will not include tags nor id attributes: f = ContactForm(auto_id=False) I think, this is exactly what you want. На Tue, 4 Oct 2011 14:34:56 +0200 Aljoša Mohorović н

Re: howto disable label for field in admin app form?

2011-10-04 Thread Aljoša Mohorović
On Tue, Oct 4, 2011 at 2:22 PM, BILLION Sébastien wrote: > It's a strange question... > You can replace an admin template with {% extends "admin/change_form.html %} > for example. i don't see why it's a strange question, i have a form field and i would like to disable rendering of label? i apprec

suggestion for dependency injection in view tests

2011-10-04 Thread Reikje
In one of my views, I am doing a call to the Facebook graph API which is a bit heavyweight and you also need a valid token. I am looking into ways to use mocking/dependency injection to avoid having to do this call during view tests. So let's say i have this view method: def suggest(request, usrid

Re: howto disable label for field in admin app form?

2011-10-04 Thread BILLION Sébastien
Add this https://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-admin-templates with that https://docs.djangoproject.com/en/dev/topics/forms/#looping-over-the-form-s-fields BILLION Sébastien the Answer to the ultimate question of life, the universe and everything is 42 http:

Re: howto disable label for field in admin app form?

2011-10-04 Thread Aljoša Mohorović
On Tue, Oct 4, 2011 at 2:20 PM, Иван Иванов wrote: > You can loop through the fields of the form and show only those parts > of the field, you need: > > https://docs.djangoproject.com/en/dev/topics/forms/#looping-over-the-form-s-fields not exactly what i'm looking for although it works ok for fro

Re: howto disable label for field in admin app form?

2011-10-04 Thread BILLION Sébastien
It's a strange question... You can replace an admin template with {% extends "admin/change_form.html %} for example. https://docs.djangoproject.com/en/dev/ref/contrib/admin/ BILLION Sébastien the Answer to the ultimate question of life, the universe and everything is 42 http://www.sebastie

Re: howto disable label for field in admin app form?

2011-10-04 Thread Иван Иванов
На Tue, 4 Oct 2011 14:05:37 +0200 Aljoša Mohorović написа: > is it possible to disable rendering of label for field in forms? > i would like to render a field in a custom form (admin add/edit form) > w/o label. any info/tips appreciated > > Aljosa > You can loop through the fields of the form a

howto disable label for field in admin app form?

2011-10-04 Thread Aljoša Mohorović
is it possible to disable rendering of label for field in forms? i would like to render a field in a custom form (admin add/edit form) w/o label. any info/tips appreciated Aljosa -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this g

Re: Django based Project Management

2011-10-04 Thread Cal Leeming [Simplicity Media Ltd]
Hi Anand - Congratulations on the new venture, always nice to see what people are using Django for. Some feedback for you; - The website design (pre-signup) is a little bit inconsistent - it's great in some places, but bad in others. * - Look at something like toggl.com for a 'clean' ex

Re: access model/instance from custom field/widget

2011-10-04 Thread Aljosa Mohorovic
the is the only way i was able to access data in field/widget, any comments? class MyForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(MyForm, self).__init__(*args, **kwargs) self.fields['my_field'].instance_data = {'instance': self.instance} self.fields

access model/instance from custom field/widget

2011-10-04 Thread Aljoša Mohorović
if i have a modelform with custom field and widget how can i access current model/instance (or None) in field/widget? is it possible? Aljosa -- 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: Report tool is supported for django .

2011-10-04 Thread BILLION Sébastien
Here: https://docs.djangoproject.com/en/dev/howto/outputting-pdf/ BILLION Sébastien the Answer to the ultimate question of life, the universe and everything is 42 http://www.sebastienbillion.com/ Le 04/10/2011 12:33, Phang Mulianto a écrit : i remember

Re: Report tool is supported for django .

2011-10-04 Thread Phang Mulianto
i remember there is how to output to pdf in the documentation.. should there any ready to use tool out there..will be nice.. On Oct 4, 2011 5:03 PM, "Le Huu Nghia" wrote: > Dear all, > > I need to make a report with django . > This report supports (chart , export PDF, Excell ...,) > please give

Re: Report tool is supported for django .

2011-10-04 Thread BILLION Sébastien
Hi, You can use existant python module like reportlab For example : http://www.devshed.com/c/a/Python/Python-for-PDF-Generation/ BILLION Sébastien the Answer to the ultimate question of life, the universe and everything is 42 http://www.se

3rd party apps with staticfiles support - howto support older versions

2011-10-04 Thread Aljoša Mohorović
given that since django v1.3 staticfiles are included and media folder is now static folder, how can a 3rd party app support v1.3 and previous releases w/o creating duplicated content in 2 folders (media and static)? Aljosa -- You received this message because you are subscribed to the Google Gr

Django-CMS and inherit plugin

2011-10-04 Thread Ivan Ivanov
Hi all! It's a silly question, but I cannot get it. What does this mean: „The inherit plugin is currently the only core-plugin which can not be used in non-cms placeholders.“ This is taken from the Django-CMS documentation: http://docs.django-cms.org/en/2.2/getting_started/plugin_reference.html#in

Report tool is supported for django .

2011-10-04 Thread Le Huu Nghia
Dear all, I need to make a report with django . This report supports (chart , export PDF, Excell ...,) please give me some recommendations with tool i must use for this case. Thanks in advance. -- You received this message because you are subscribed to the Google Groups "Django users" group. T

Re: effective adding records in Django site admin

2011-10-04 Thread Thomas Orozco
Regarding your first question, the admin save_as field does exactly this. Le 4 oct. 2011 07:01, "veva...@yandex.ru" a écrit : -- 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

crashes on long queries

2011-10-04 Thread Bram de Jong
Hello all, On Freesound.org we run a stack of nginx / django via flup / supervisorcontrol (for keeping the workers up) + postgres on another machine We have noticed that if we run long queries (for example deleting an object with many, many cascades) everything crashes. More specifically, our wo

Re: can't get STATICFILES to work (Django dev version)

2011-10-04 Thread Mike Dewhirst
On 3/10/2011 10:00pm, Gelonida N wrote: On 09/26/2011 10:21 PM, nara wrote: I am having trouble getting STATICFILES to work. I have read the docs, and followed the instructions, but I never get my css files to load. My current workaround is to put all the css inline in my template file, but that

Re: effective adding records in Django site admin

2011-10-04 Thread Ilian Iliev
Hi, you can always create custom admin page for your models by extending the default admin. -- eng. Ilian Iliev Web Software Developer Mobile: +359 88 66 08 400 Website: http://ilian.i-n-i.org On Tue, Oct 4, 2011 at 8:01 AM, veva...@yandex.ru wrote: > Good morning! > Could you tell me, is