Re: manager.raw returning Capitalized field names

2010-05-20 Thread Russell Keith-Magee
class CheckIn(models.Model): sample_id = models.AutoField(db_column='SampleID', primary_key=True) date_arrived = models.DateField(db_column='DateArrived') company_name = models.CharField(max_length=100, db_column='Company') < plus any extra fields > class Meta: db_table

Re: Module loading error in django trunk.

2010-05-20 Thread ben
On May 18, 9:35 pm, Russell Keith-Magee wrote: > On Tue, May 18, 2010 at 6:12 PM, ben wrote: > > Hi All, > > > After a recent svn update to my copy of Django/trunk I’ve been getting > > a persistent error relating to module loading (see below). I am able > > to create the same error from many b

Django list_filter

2010-05-20 Thread Danfi
Hi, In my models, I use "parent = models.ForeignKey('self', blank = True, null = True) " create a Folder tree like : A -a1 -a2 --a21 --a211 --a22 B -b1 and I use the "parent" as list_filter ,but I get a problem , when I click 'a1' ,it only show the information in a1, but I want it also show its ch

Re: Module loading error in django trunk.

2010-05-20 Thread Russell Keith-Magee
On Thu, May 20, 2010 at 3:17 PM, ben wrote: > > > On May 18, 9:35 pm, Russell Keith-Magee > wrote: >> On Tue, May 18, 2010 at 6:12 PM, ben wrote: >> > Hi All, >> >> > After a recent svn update to my copy of Django/trunk I’ve been getting >> > a persistent error relating to module loading (see be

Re: trying not to do any operations in template, but not sure i can avoid it.

2010-05-20 Thread shofty
thanks for the swift response. On May 19, 10:05 pm, Bill Freeman wrote: > You could put a method on your basket object which calculates the shipping. > Then if the basket object is included in the context, you can trivially call > it. > That seems simple enough for me to do. > Or perhaps bette

Re: Module loading error in django trunk.

2010-05-20 Thread njoyce
> Now that we have a fully PEP 302 compliant loading structure, it is exposing > bugs in the PyAMF loader implementation. Indeed it is - we have already come across this issue and fixed it - check http://dev.pyamf.org/ticket/770 for details. Cheers, Nick -- You received this message because y

Re: django filters

2010-05-20 Thread Peter Bengtsson
The way you set up the ordering (e.g. 'change_date') just change that to '-change_date'. A minus in front of the ordering keyword reverses the sort order. On 20 May, 06:32, rahul jain wrote: > Hi, > > In my model, I have set up one filter which helps in filtering out the > results on admin Panel.

Re: Django list_filter

2010-05-20 Thread Peter Bengtsson
There are much more efficient tree implementation made available for Django. https://tabo.pe/projects/django-treebeard/ A much better place to start. On 20 May, 07:06, Danfi wrote: > Hi, > In my models, I use "parent = models.ForeignKey('self', blank = True, > null = True) " create a Folder tree

Hyperlog

2010-05-20 Thread Marcob
Have you ever wanted to check the contents of a session or to search the django_admin_log table? Probably you will find this "free-and-little-more-than-a-snippet- project" useful: http://code.google.com/p/hyperlog/ Enjoy :-) Ciao. Marco. -- http://thinkcode.tv/catalog/amazing-python - Capir

Reorder fields in tabular admin inline

2010-05-20 Thread Dirk Eschler
Hello, is there an easy way to reorder field display in a tabular admin inline, like fieldsets for common admin forms? Consider the following models, with Bar being edited inline: class Foo(models.Model): field1 = models.CharField(max_length=255) field2 = models.CharField(max_length=255

Re: Uploaded File Security

2010-05-20 Thread Tomasz Zieliński
On 20 Maj, 04:19, Mike Dewhirst wrote: > > If it has to be secure rather than just wishful thinking the webserver > must demand credentials. If you are using Apache, that means .htaccess > files which point to a list of credentials for each group. > What is the difference between long, random f

How to enable Static Generator

2010-05-20 Thread vikk
Hi all, I got some of the documents to enable static generator but still for away from the result. Please show me the way to implement it for my site so that I can enhance the performance. I am using apache + mod_wsgi. I need to get detail about the apache configuration. How can I configure it for

Re: Uploaded File Security

2010-05-20 Thread Torsten Bronger
Hallöchen! Tomasz Zieliński writes: > On 20 Maj, 04:19, Mike Dewhirst wrote: > >> If it has to be secure rather than just wishful thinking the >> webserver must demand credentials. If you are using Apache, that >> means .htaccess files which point to a list of credentials for >> each group. > >

Re: New with Django

2010-05-20 Thread Mehul
thank you so much On Apr 23, 8:19 pm, Nick Serra wrote: > Whenever I use django on my windows box, i use XAMPP, which is a all > in one installer that gets apache and mysql. > > So I: > - install XAMPP > - install python > - svn checkout django in the site-packages folder > - install mysql bindin

djangojs translations not available

2010-05-20 Thread filias
Hi, I have a djangojs.po file and am compiling the messages with compilemessages command. I don't get any error but I can't see my translations in the js catalog. I can only see the admin js translations. How can I debug this problem? Thanks in advance. -- You received this message because you

Re: Django Sphinx Foreign key search

2010-05-20 Thread David De La Harpe Golden
On 13/04/10 09:04, urukay wrote: Hi, I'm trying to create full text search on model, everything goes fine when searching TextFields but I have a problem with ForeignKey field. How can i do that? Can anyone point me to the right direction? Do you mean you want the results for Model2 searches

Re: djangojs translations not available

2010-05-20 Thread filias
So, I managed to fix the problem. If some has the same problem here are some useful infos: - if you have a normal setting.py file then you should not have this problem with djangojs domain translations - if you have your settings.py file split into several sub-settings the locale directory should

Re: Uploaded File Security

2010-05-20 Thread SQ9MEV
Lee Hinde pisze: > What's best practice here? Yet another way using nginx as a webserver: http://wiki.nginx.org/NginxHttpAccessKeyModule -- Bart -- 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...@

Re: Uploaded File Security

2010-05-20 Thread SQ9MEV
SQ9MEV pisze: > Lee Hinde pisze: >> What's best practice here? > Yet another way using nginx as a webserver: > http://wiki.nginx.org/NginxHttpAccessKeyModule And another one: http://wiki.nginx.org/NginxHttpSecureDownload -- Bart -- You received this message because you are subscribed to the Goog

admin fieldsets ?

2010-05-20 Thread paul wisehart
I'm really liking customizing the admin. I would like to know if I could use the change_view.html template with my own form data. My question is how do I setup a fieldset from some arbitrary form such that I can pass it to a change_view.html page. I see that there is a admin/includes/fieldset.ht

Re: Django list_filter

2010-05-20 Thread Danfi
Thanks Peter ! But I don't want to use these, I want to know how to realize it, maybe I have to refer to them. On May 20, 5:59 pm, Peter Bengtsson wrote: > There are much more efficient tree implementation made available for > Django.https://tabo.pe/projects/django-treebeard/ > A much better plac

Django reversion, AuditTrail, MySQL MyISAM

2010-05-20 Thread Chris Allen
I'm trying to get rid of a weak Updates table that a coworker had been hacking up for use as a "user was changed on such and such day/ time..." and replace it with AuditTrail but there are a number of confounding issues. AuditTrail: I don't have the User model overridden, how would I hook it into

Re: trying not to do any operations in template, but not sure i can avoid it.

2010-05-20 Thread Bill Freeman
On Thu, May 20, 2010 at 4:24 AM, shofty wrote: > thanks for the swift response. > > On May 19, 10:05 pm, Bill Freeman wrote: >> You could put a method on your basket object which calculates the shipping. >> Then if the basket object is included in the context, you can trivially call >> it. >> >

Re: No stylesheet in administration panel

2010-05-20 Thread Carlo Trimarchi
On 18 May 2010 17:30, Mitch Anderson wrote: > Depending on your ADMIN_MEDIA_PREFIX in settings.py (default is /media/) > > your webserver should be configured to point to the django admin media > location... > > I have this line in my apache config > > Alias /media/ /usr/share/pyshared/django/cont

Looking for a Django Developer

2010-05-20 Thread Aquent Tree
For a one month contract opportunity in Toronto, offsite will be considered as well. Individuals only, no third party companies, sorry:) Please contact me directly at tperro...@aquent.com as soon as possible if you're interested. Cheers! Aquent Tree -- You received this message because you are s

IronPython AssertionError

2010-05-20 Thread Joe D
Has anyone had any luck running Django on IronPython ? I get the following error: File "C:\vcs\django\django\utils\functional.py", line 180, in __prepare_class__ AssertionError: Cannot call lazy() with both str and unicode return types. I tried with the release version of django (1.2) as well as

Re: admin media and template override ignored after switch to 1.2rc

2010-05-20 Thread C4m1l0
I've resolved my problem, the django project was in the directory "/ var/aplicações". So I've tried to access the folder "media/css" and I couldn't because django couldn't resolve name "apilcações". So, I've just rename the folder. On May 18, 5:37 pm, C4m1l0 wrote: > Hi, I've encountered the same

Multi-table inheritance and child model admin add pages

2010-05-20 Thread peppo
Hi, I have the following problem with admin and multi table inheritance I don't understand (django 1.1.1). Model definition class Place(models.Model): name = models.CharField(max_length=50) address = models.CharField(max_length=80) class Restaurant(Place): serves_hot_dogs = models.Bo

Re: Multi-table inheritance and child model admin add pages

2010-05-20 Thread Karen Tracey
On Thu, May 20, 2010 at 4:26 PM, peppo wrote: > I have the following problem with admin and multi table inheritance I > don't understand (django 1.1.1). > > Model definition > > class Place(models.Model): >name = models.CharField(max_length=50) >address = models.CharField(max_length=80) >

Re: Multi-table inheritance and child model admin add pages

2010-05-20 Thread peppo
Thanks Karen for the reply. I overlooked the ticket you mention. Just for reference for others reading in the future this thread, here is a simpler (and more portable) solution other than applying the patch attached to http://code.djangoproject.com/ticket/7623. If you modify the child model as fo

Reload WSGI per request?

2010-05-20 Thread VWAllen
I have my project set up to use Apache/mod_wsgi with different configs for dev, staging and production. I'd like to set up my dev server to automatically reload the WSGI app per request (without touching my django.wsgi file each time). I looked at two wsgi middleware projects, memento and amnesia,

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 & Python Consulting

Re: more complex queries

2010-05-20 Thread John M
Sounds like two queries to me, sum all the refunds and then subtract them from all the non-refund amounts. does that work for ya? On May 20, 5:17 pm, Chris Withers wrote: > Hi All, > > I have a Transaction model with a DecimalField called "amount" and a > CharField called "action". > > How do I

Re: more complex queries

2010-05-20 Thread Chris Withers
John M wrote: Sounds like two queries to me, sum all the refunds and then subtract them from all the non-refund amounts. does that work for ya? Not really, that requires two queries. I know this can be done in one query in SQL, just wondering how to express that in Django ORM speak... Chris

Re: group password

2010-05-20 Thread Eric Chamberlain
I would use auth.User as is. When a new user (no existing django session) enters the code, django creates a user account (random username and password) behind the scenes and logs in the user. Then the user is identifiable as long as they stay on that machine. Set the logout interval to whatev

Re: If is first time logging in

2010-05-20 Thread Eric Chamberlain
Anything wrong with adding a flag to the profile model? If the flag is not set, show the profile stuff? It keeps all the profile management in one model. The "flag" could even be a timestamp, so you could show the prompt again, if after X time the user has not added anything to their profile.

Re: more complex queries

2010-05-20 Thread Shawn Milochik
You could create your own manager and have it do whatever you want -- even run the SQL query you already want to write and still return a queryset. http://docs.djangoproject.com/en/1.1/topics/db/managers/#id2 Shawn -- You received this message because you are subscribed to the Google Groups "

URL Fetching Method Timing Out? Strange problem

2010-05-20 Thread Eric
Hi, I'm writing a facebook app with django and it is running on google app engine. Part of the application is calculating the strength of a relationship between friends, and classifying it as 1 (weak), 2 (acquaintance), or 3 (close bond). A copy of the relevant code is http://pastebin.com/AtQZDu65

How can you include annotated results in a serialized QuerySet

2010-05-20 Thread Werner
Hello, How can you include annotated results in a serialized QuerySet? I have this serialized query: serializers.serialize('json', Song.objects.filter(is_playing=False).annotate(nr_votes=Count('votes')).order_by('-nr_votes')) However the key/value pare {'nr_votes': number} is not include into t

Re: Reload WSGI per request?

2010-05-20 Thread Matt Cooney
On Fri, May 21, 2010 at 11:45 AM, VWAllen wrote: > I have my project set up to use Apache/mod_wsgi with different configs > for dev, staging and production. I'd like to set up my dev server to > automatically reload the WSGI app per request (without touching my > django.wsgi file each time). I'

is it possible ?

2010-05-20 Thread rahul jain
Hi Everyone, I would like to implement different views in admin panel based on the user. if the user is any other user apart from admin then for all those models, the user should just be able to see those objects,( no change, delete and add). Those users should also not see the select boxes or b

Re: Reload WSGI per request?

2010-05-20 Thread Graham Dumpleton
On May 21, 9:45 am, VWAllen wrote: > I have my project set up to use Apache/mod_wsgi with different configs > for dev, staging and production. I'd like to set up my dev server to > automatically reload the WSGI app per request (without touching my > django.wsgi file each time). If you want to d

Re: is it possible ?

2010-05-20 Thread Danfi
In Auth group you can create a group and set the limits. see different panel maybe use changelist_view I saw this just be similar to yours' class Part(models.Model): is_deleted = models.BooleanField() // class PartAdmin(admin.ModelAdmin): actions =None

Re: IronPython AssertionError

2010-05-20 Thread Russell Keith-Magee
On Fri, May 21, 2010 at 1:47 AM, Joe D wrote: > Has anyone had any luck running Django on IronPython ? Testing under IronPython hasn't been part of our regular testing regimen, so I can't comment on the level of compatibility. > This seems to have been reported to the IronPython team here: > > h

Re: How can you include annotated results in a serialized QuerySet

2010-05-20 Thread Russell Keith-Magee
On Fri, May 21, 2010 at 9:41 AM, Werner wrote: > Hello, > > How can you include annotated results in a serialized QuerySet? > > I have this serialized query: > serializers.serialize('json', > Song.objects.filter(is_playing=False).annotate(nr_votes=Count('votes')).order_by('-nr_votes')) > > Howeve

Re: is it possible ?

2010-05-20 Thread rahul jain
Hi Danfi, Thanks for your quick response. But can you explain a little more how can we connect ChangeList class with that function change_view. Confuse about it. --RJ 2010/5/20 Danfi : > In Auth group you can create a group and set the limits. > > see different panel maybe use changelist_view