Re: Two ForeignKeys to show a combo in admin

2010-10-25 Thread derek
You'll need to use AJAX - I suggest you look at: http://www.texotela.co.uk/code/jquery/select/ There are also other ways of pre-filtering a model's choices... have a look at: http://www.stereoplex.com/blog/filtering-dropdown-lists-in-the-django-admin and http://www.artfulcode.net/articles/runtime-

Re: Slug auto-complete after save

2010-10-25 Thread Alex
File "admin_modify.py" method "def prepopulated_fields_js(context)" Line 11: if context['add'] and 'adminform' in context: should be changed to if 'adminform' in context: to allow slug be auto updated every time and not only on the entity creation in admin. Is there any setting to do it withou

Re: inheriting User class

2010-10-25 Thread Miguel Araujo
Thanks Rob, I'm using the same approach here, but I don't really like to access some of my fields in the template doing `user.get_profile.field` I would simply love to do `user.field`. Also Sometimes I'm pointing to my profile instead of User, to access the extra information so queries become more

Re: possible bug in joining on a geo field

2010-10-25 Thread Miguel Araujo
Should I report it? who should I contact? Anyone can confirm this is a bug? 2010/10/23 Miguel Araujo > Thanks Karen, you are right. But I missed the underscore for sending this, > although I was trying here with double underscore: > > So If I do it right: > > Item.objects.filter(location__point_

Re: Slug auto-complete after save

2010-10-25 Thread Piotr Kilczuk
Hi Alex, 2010/10/25 Alex > File "admin_modify.py" method "def prepopulated_fields_js(context)" > Line 11: > > if context['add'] and 'adminform' in context: > > should be changed to > > if 'adminform' in context: > > to allow slug be auto updated every time and not only on the entity > creation i

Re: The same table in 2 apps

2010-10-25 Thread robos85
Yes that's exactly what I mean. I have defined class "Links" in one of the app, and want to use it in another app (user profile) to show all user's links. After reading this links I see, that there's nothing wrong in linking models from another apps. I read that part of manual, but I didn't remembe

Re: Two ForeignKeys to show a combo in admin

2010-10-25 Thread Alexandre González
Thanks derek! I will test it ASAP :) On Mon, Oct 25, 2010 at 09:41, derek wrote: > You'll need to use AJAX - I suggest you look at: > http://www.texotela.co.uk/code/jquery/select/ > > There are also other ways of pre-filtering a model's choices... have a > look at: > http://www.stereoplex.com/bl

django-paypal

2010-10-25 Thread Venkatraman S
Hi, I am using dcramer's version of django-paypal(but i think it shouldnt matter whether it is dcramer or johnboxall's). How can i specify multiple items in my paypal_dict(to be used in PayPalPaymentsForm)? I need to suitably specify the shipping cost and the individual quantities in the Summary

How to display image in django template

2010-10-25 Thread d
Hi all I have been searching for solutions whole day. How would I display image file in django template. I have already set MEDIA_ROOT and MEDIA_URL. Can some one show a step by step instruction as it will help a lot of other people. Thanks! -- You received this message because you are subscrib

Re: How to display image in django template

2010-10-25 Thread Venkatraman S
On Mon, Oct 25, 2010 at 4:04 PM, d wrote: > I have been searching for solutions whole day. > How would I display image file in django template. I have already set > MEDIA_ROOT and MEDIA_URL. > You mean image as in static image or from Image model? If static image, then this is the process: - le

Re: How to display image in django template

2010-10-25 Thread Kenneth Gonsalves
On Mon, 2010-10-25 at 03:34 -0700, d wrote: > I have been searching for solutions whole day. > How would I display image file in django template. I have already set > MEDIA_ROOT and MEDIA_URL. assume a model: Mymodel(models.Model): photo = models.ImageField("somename",upload_to="images/") get a

Security

2010-10-25 Thread cootetom
Hi, a firefox extension was recently released to grab session ID cookies from a private network for the popular sites like facebook etc You can read about it here http://goo.gl/x4Z1 I was wondering how Django sits with this type of attack. I know there are the CSRF tokens, do they prevent this tho

Re: how can i wsdl file in my django

2010-10-25 Thread sami nathan
Can i use RESTfull insted of SOAP service -- 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. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.co

Re: how can i wsdl file in my django

2010-10-25 Thread Brian Bouterse
yes Maybe next time put a little more effort into writing your response and you'll get a better answer. On Mon, Oct 25, 2010 at 6:58 AM, sami nathan wrote: > Can i use RESTfull insted of SOAP service > > -- > You received this message because you are subscribed to the Google Groups > "Django us

Re: Security

2010-10-25 Thread Brian Bouterse
I'm not an expert in security, but here is how I would answer the question. The CSRF approach that Django 1.2 implements would prevent *most* of these problems since the attack wouldn't be able to POST new data to the site by stealing the cookie alone. IBM applies CSRF tags to each step the user

Re: Security

2010-10-25 Thread Tom Evans
On Mon, Oct 25, 2010 at 1:17 PM, Brian Bouterse wrote: > I'm not an expert in security, but here is how I would answer the question. >  The CSRF approach that Django 1.2 implements would prevent *most* of these > problems since the attack wouldn't be able to POST new data to the site by > stealing

Re: Security

2010-10-25 Thread Brian Bouterse
Thanks for the info! Brian On Mon, Oct 25, 2010 at 8:44 AM, Tom Evans wrote: > On Mon, Oct 25, 2010 at 1:17 PM, Brian Bouterse > wrote: > > I'm not an expert in security, but here is how I would answer the > question. > > The CSRF approach that Django 1.2 implements would prevent *most* of >

Creating a common URL prefix?

2010-10-25 Thread Oliver Beattie
Hi all, I have a bit of an conundrum for you that I'm a little stumped with… I'm wondering whether I'm missing something painfully simple in my search of rather complicated options. Basically, I need a prefix on all URLs (for instance /uk/ or /us/), but I don't want each and every view to have to

ManytoMany initial values

2010-10-25 Thread Giancarlo Razzolini
Hi all, I've been using django for some time now and I must say that it's my favorite framework. But lately I've run into a problem. Let's say I have the following models: class Contact(models.Model): id = models.AutoField(primary_key=True) user = models.ForeignKey(User, edit

Re: how can i wsdl file in my django

2010-10-25 Thread sami nathan
I think following is opt ans for my question Mr Brian Bouterse No matter the tools you have, it's hard to make a WSDL for a RESTful service. WSDL 1.1, after all, was specifically designed to describe services built using SOAP. In response, the Web Application Development Language (WADL) was cre

Re: What does an ideal django workflow setup look like?

2010-10-25 Thread Tom Evans
When this came up another time, a better approach was explained to me. Rather than settings.py 'under version control'*, you keep settings_default.py as your universal settings file. This is then imported into settings.py. The advantage of this is that you don't need to do clever tricks in your se

Re: Embed the file system path to a template??

2010-10-25 Thread Russell Keith-Magee
On Sun, Oct 24, 2010 at 11:47 PM, Joakim Hove wrote: > Hello, > > to assist those responsible for the content of "my" site I would like > to embed the file-system path to the template in the rendered > template, so that when they find something they are dissatisfied with > on a page they can do "V

Re: Creating a common URL prefix?

2010-10-25 Thread Benoit
Hi, Django-localeurl does something like this. I've successfully implemented it in several projects. http://bitbucket.org/carljm/django-localeurl/ http://pypi.python.org/pypi/django-localeurl/1.4 Benoit Clennett-Sirois On Mon, Oct 25, 2010 at 8:54 AM, Oliver Beattie wrote: > Hi all, > > I ha

Still Confused about Python Egg Cache

2010-10-25 Thread octopusgrabbus
I've added PythonInterpreter amr_django PythonImport /home/amr/django/amr/python_egg_cache.py amr_django to /etc/init.d/conf/httpd.conf. Here's python_egg_cache.py import os os.environ['PYTHON_EGG_CACHE'] = '/python_egg_cache/.python-eggs' This was working a few days ago, after I added the con

Re: Still Confused about Python Egg Cache

2010-10-25 Thread octopusgrabbus
I'm sorry for being so bouncy about this. Fixed again, but with different instructions. SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE settings SetEnv PYTHON_EGG_CACHE /tmp PythonOption django.root /home

Re: Embed the file system path to a template??

2010-10-25 Thread Joakim Hove
> However, if you just want to know the top-level template that started > the rendering process, you could obtain this by writing a custom > render_to_template() shortcut that inserts the loaded template name > into the context. Thank you, I considered writing this custom render_to_template() s

django page cms get_absolute_url return an empty strings andURL issues.

2010-10-25 Thread tricks...@googlemail.com
I am having issues with get_absolute_url in my django templates when using django page cms. It returns an empty string and does not link to my required page. I have the following Models, URLs templates and views Models class Body(models.Model): ... url = models.SlugField(unique=True, help_text='

Unable to filter a query on >1 ManyToMany relationships

2010-10-25 Thread Jumpfroggy
I have a class like this: class Node: name = models.CharField() parents = models.ManyToManyField('self', symmetrical=False, related_name='child_nodes', null=True, blank=True) This allows a basic parent(s)/children hierarchy. A node can have >= 0 parents. A parent can have >= 0 children

Re: What does an ideal django workflow setup look like?

2010-10-25 Thread Jumpfroggy
This is such a great thread! I'd love to see a wiki page detailing some good setup ideas. It's such a leap forward from the nuts & bolts of "How do I install django" and "How do I run a complex query" to this... "How do I use django more effectively, end to end?" I agree - most of these tips wil

Connecting to Multiple MSSQL Databases... I've hit an edge case. Help, please!

2010-10-25 Thread Steven L Smith
For one of our apps, I'm using django-pyodbc to connect to an MS SQL 2005 database (not my choice...) This database contains, among other things, rows for the Person model. I've written a function to connect to "Lenel", an access-card system used by our campus security department, which pulls the p

Re: Is there some way to log every SQL command sent to the DB?

2010-10-25 Thread Phlip
> You could turn on logging through your DB Hey! Thinking outside the box is MY job!! grumble grumble grumble thanks grumble... -- 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.

Re: ManytoMany initial values

2010-10-25 Thread Jumpfroggy
Giancarlo, I've run into this trouble myself. The problem here is the widget itself. It does exactly what you described: -Shows all possible values for the ManyToMany field. -Highlights the "active" or "selected" values. These correspond to items in that list/array/queryset. For any more than

Re: ManytoMany initial values

2010-10-25 Thread Jumpfroggy
On Mon, Oct 25, 2010 at 2:23 PM, Giancarlo Razzolini wrote: > James, > First of all thank you for the fast response. I'll take a look into the > admin forms widgets. I'm already looking for third party applications field > types and widgets to see if I find one that does what I want. I was eve

dealing with BLOB field and encoding of the text.

2010-10-25 Thread Harsha Reddy
Hi All, I have hit a road block in trying to read BLOB data {of some encoding other than UTF-8 or any other unicode} in Django for display. The SQLite database that I am dealing with has a table, the columns of it which stores the command, output are of type BLOB and the data being stored is in S

Re: What does an ideal django workflow setup look like?

2010-10-25 Thread Brian Bouterse
I really can't encourage the use of Hudson (or something like it). It's a great tool to plug scripts into, and gives you added features if configured properly such as running test cases automatically, giving code coverage reports, pylintr

model forms/formset poor performance

2010-10-25 Thread SlafS
Hi there! I'm developing a small django app with some models and modelformsets. Using Django Debug-Toolbar I noticed the overhead (in my particular case) which Django makes by performing extra queries to validate a form in a formset http://dpaste.com/hold/263886/ I know that this is needed in ma

RE: Connecting to Multiple MSSQL Databases... I've hit an edge case. Help, please!

2010-10-25 Thread Henrik Genssen
just use cursor.close() to close the cursor. is leaking in the sample... Henrik >reply to message: >date: 25.10.2010 13:51:12 >from: "Steven L Smith" >to: "Django users" >subject: Connecting to Multiple MSSQL Databases... I've hit an edge case. >Help, please! > >For one of our apps, I'm using

Re: Users table

2010-10-25 Thread miksayer
Thanx everybody. -- 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. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visi

Re: Embed the file system path to a template??

2010-10-25 Thread Russell Keith-Magee
On Tue, Oct 26, 2010 at 1:05 AM, Joakim Hove wrote: > >> However, if you just want to know the top-level template that started >> the rendering process, you could obtain this by writing a custom >> render_to_template() shortcut that inserts the loaded template name >> into the context. > > Thank y

Re: my first (public) app: django-requires_js_css

2010-10-25 Thread Jason Persampieri
Thanks for the feedback! Glad to know I'm on the trail of something that's actually needed :) I haven't delved in to Django internals enough yet (still really just getting started with Django) to evaluate what can be done with lower- level changes. And while I briefly went down the path of a sep

Override DECIMAL_SEPARATOR in certain cases?

2010-10-25 Thread Joachim Pileborg
In my application I have LANGUAGE_CODE set to 'sv-SE', which uses comma as decimal separator. When using a model field containing a floating point number as argument to a Javascript function, or when sending the number to an external site (in my case as coordinates to get a static map from Google M

SELECT * FROM `student` WHERE mark=(select max(mark) from student)

2010-10-25 Thread Phlip
Does anyone have a QuerySet for that? ( BTW please don't try to talk me out of it; I've been doing SQL since 1989 and am fully aware of all the alternatives there. C-; ) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Re: What does an ideal django workflow setup look like?

2010-10-25 Thread Kenneth Gonsalves
On Mon, 2010-10-25 at 16:06 -0400, Brian Bouterse wrote: > I really can't encourage the use of Hudson (or > something like it). 'cant encourage'? or 'can encourage'? -- regards Kenneth Gonsalves Senior Associate NRC-FOSS at AU-KBC -- You received this message because y

Re: How to get request.user when Django emails a 500 error report?

2010-10-25 Thread Sid
I wrote a middleware that adds a process_exception handler. It adds the user info to the request.META so they show up in emails. See http://gist.github.com/646372 You can modify that to add any info to the emails. Sid http://sidmitra.com On Oct 16, 3:20 am, Margie Roginski wrote: > I finally

Re: Adding username to the 500 error emails

2010-10-25 Thread Sid
See http://gist.github.com/646372 , which also uses process_exception handler. -Sid http://sidmitra.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-us...@googlegroups.com. To unsubscribe from th

Re: SELECT * FROM `student` WHERE mark=(select max(mark) from student)

2010-10-25 Thread ankit rai
say your model name is Student, and it has a field names as marks query set will be Student.objects.all().aggregate(Max('marks') this will be give you max marks st=Student.objects.filter(marks__in=Student.objects.all().aggregate(Max('marks'))) --ankit On Tue, Oct 26, 2010 at 9:28 AM, Phlip w