referencing fields on the model without F()

2011-04-13 Thread Roman Klesel
Hello, I have an old version of django here where the F() object is not available (0.96). Is there a chance to reference a field on the same model without using using F()? I'd like to write: hw=Hardware.objects.filter(he=F('rack__he')) ... but there is no F() in this version. Any ideas? Rega

Re: New to Django-Installation problem

2011-04-13 Thread PremAnand Lakshmanan
Yes, that was the problem..It installed properly now.. On Wed, Apr 13, 2011 at 5:32 AM, werefr0g wrote: > Are you using python 3? > > -- > 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

Using Q objects vs explicit filters

2011-04-13 Thread Gianluca Sforna
In writing a complex filter for an application, I've found a different behavior between a filter like: Model.objects.exclude(filter1, filter2) and one like: Model.objects.exclude(Q(filter1), Q(filter2)) where filter1 and filter2 are both field lookups on related models; in particular only the sec

Re: Password Auto-reset and Expiry Policy (every X Months)

2011-04-13 Thread gladys
Django's auth module will do just fine. You can store other information, such as 'date_password_modified' in a model (UserProfile perhaps) which has a one-to-one correspondence with User. Then you need to override the login view to check the validity of the password based on this field. Now to det

Re: get_object_or_404 Tutorial part 3

2011-04-13 Thread Yuka Poppe
Dear darekodz, I noticed this myself a while back; It was'nt django specific, and I dont know about IE, I generally try to avoid using that; But in case of Chrome, whenever it encounters a 404 error (or certain other conditions) it seems to decide the visitor is better off being served a generic g

Re: Using Q objects vs explicit filters

2011-04-13 Thread Brian Bouterse
Could you include the output to highlight the differences? Brian On Wed, Apr 13, 2011 at 9:32 AM, Gianluca Sforna wrote: > In writing a complex filter for an application, I've found a different > behavior between a filter like: > Model.objects.exclude(filter1, filter2) > > and one like: > Model

Looking For A Solid Learning Tutorial

2011-04-13 Thread Nick Hird
I am just starting out with Django and would love to find a tutorial that is great for learning but also teaches the many aspects of the framework. I have a few books but they seem to go off on one direction or another and skip the basics to really get you up and running. I would like to build a so

Re: referencing fields on the model without F()

2011-04-13 Thread Yuka Poppe
You could possibly resort to the extra() queryset method, allthough it eats raw sql, its documented in the manual. Im not sure if its in 0.96 though. -- Regards, Yuka On Wed, Apr 13, 2011 at 3:09 PM, Roman Klesel wrote: > Hello, > > I have an old version of django here where the F() object is n

Re: Looking For A Solid Learning Tutorial

2011-04-13 Thread Shawn Milochik
Try James Bennett's book, "Practical Django Projects." It walks you step-by-step through creating full apps. Shawn -- 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 unsubscri

Re: referencing fields on the model without F()

2011-04-13 Thread Roman Klesel
Hello Yuka, 2011/4/13 Yuka Poppe : > You could possibly resort to the extra() queryset method, allthough it eats > raw sql, its documented in the manual. Im not sure if its in 0.96 though. Yes, thanks! I think I found a solution: hw=Hardware.objects\ .filter(rack__he__isnull

Re: Looking For A Solid Learning Tutorial

2011-04-13 Thread Baurzhan Ismagulov
On Wed, Apr 13, 2011 at 09:19:31AM -0400, Nick Hird wrote: > I am just starting out with Django and would love to find a tutorial that is > great for learning but also teaches the many aspects of the framework. I > have a few books but they seem to go off on one direction or another and > skip the

Re: Redoing a C/CGI web app in Python/Django?

2011-04-13 Thread lilspikey
You could refactor the C code into a library, then call it from Django. There are several ways to interface with a C library in Python, but you might want to look at ctypes: http://docs.python.org/library/ctypes.html It means you don't have to write extra C code just to do the interfacing. On

Re: Looking For A Solid Learning Tutorial

2011-04-13 Thread jsierra
Also http://docs.djangoproject.com/en/1.3/topics/ is another place to look for more focused topics that aren't covered in detail in the tutorials. I found the documentation and tutorials that I find through searching Google to be more than sufficient for learning and figuring my way around djan

Re: Admin Interface Super User Not Logging In

2011-04-13 Thread bruno desthuilliers
Beware of non-printable characters when copy-pasting the password ;) More seriously: this is the only reason I can think of that would explain your problem :-/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: How to insert a csrf_token when entering datas through a bot ?

2011-04-13 Thread dave b
On 12 April 2011 22:09, JustinMarsan wrote: > Hello, > > What would be the best way to allow some bots to POST some content to > a website. Without crsf_token, the bot will get a 403, and I would > prefer not to remove this behavior but rather find a way to make the > bot send a token. How could I

Re: Looking For A Solid Learning Tutorial

2011-04-13 Thread 小白
Yes I think "Practical Django Projects" is very good for newbie, after reading that i start my own job using Django to setup a CMS. On Wed, Apr 13, 2011 at 9:55 PM, Shawn Milochik wrote: > Try James Bennett's book, "Practical Django Projects." > > It walks you step-by-step through creating full

Re: Creating this query with django Models

2011-04-13 Thread Martin J. Laubach
What problems did you encounter? It's easier to help you knowing what went wrong. mjl -- 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 unsubscribe from this group,

Re: Creating this query with django Models

2011-04-13 Thread Martin J. Laubach
What problems did you encounter? It's easier to help you knowing what went wrong. mjl -- 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 unsubscribe from this group,

Re: get_object_or_404 Tutorial part 3

2011-04-13 Thread Jacob Kaplan-Moss
On Wed, Apr 13, 2011 at 6:41 AM, Yuka Poppe wrote: > I noticed this myself a while back; It was'nt django specific, and I dont > know about IE, I generally try to avoid using that; But in case of Chrome, > whenever it encounters a 404 error (or certain other conditions) it seems to > decide the vi

Re: get_object_or_404 Tutorial part 3

2011-04-13 Thread Yuka Poppe
> I believe that the cutoff is 512 bytes, but you may want to test in > different browsers to be sure. I suspected as much but wasnt quite sure, it didn't matter as much at the time I had to deal with it, and the problem went away by itself. None the less its nice to have this information floating

Re: Redoing a C/CGI web app in Python/Django?

2011-04-13 Thread Graeck
Thanks, I think that might be what I was looking for. On Apr 13, 7:10 am, lilspikey wrote: > You could refactor the C code into a library, then call it from > Django. > > There are several ways to interface with a C library in Python, but > you might want to look at ctypes: > >  http://docs.pyth

RE: [Suspected Spam] Redoing a C/CGI web app in Python/Django?

2011-04-13 Thread Sells, Fred
That's essentially what google does. I would suggest dealing with the Python~C integration/test as a command line execution and when that works, learn to call the python wrapper from django. It's been 15 years since I actually did any of this, but it is pretty straight forward with SWIG. There a

RE: Best Practice for Raw SQL

2011-04-13 Thread Sells, Fred
In my case I had to read some legacy data from a different schema on the same MySQL server and it was easy (but perhaps not elegant) to just establish a separate connection using MySQLdb module. -Original Message- From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] O

Re: Best Practice for Raw SQL

2011-04-13 Thread Nick Arnett
On Wed, Apr 13, 2011 at 1:38 PM, Sells, Fred wrote: > In my case I had to read some legacy data from a different schema on the > same MySQL server and it was easy (but perhaps not elegant) to just > establish a separate connection using MySQLdb module. You shouldn't have to do that. Use this:

RE: Best Practice for Raw SQL

2011-04-13 Thread Sells, Fred
Xcellent improvement; that's (my code) what happens when you're too busy fixing the problem to learn the tool ;) From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Nick Arnett Sent: Wednesday, April 13, 2011 4:44 PM To: django-users@googlegroups.com Subject:

Re: Admin Interface Super User Not Logging In

2011-04-13 Thread gladys
There's no way you can check if the password is correct by querying the db. What you can do is try changing the pass thru user.set_password('some- pass') and see if the login will work. -- Gladys http://blog.bixly.com On Apr 13, 10:44 pm, bruno desthuilliers wrote: > Beware of non-printable ch

Re: Admin Interface Super User Not Logging In

2011-04-13 Thread Joseph Hunt
If you're running the "testserver" it's not using the database, you'll want to try "runserver" instead. -- 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 unsubscribe from this

ANN: DSE 1.0.0-RC1

2011-04-13 Thread Thomas Weholt
Hi, A short description to wet your appetite: DSE is simplified "bulk" insert/update for django, created for one simple reason - to insert or update lots of data as fast as possible ( and still be developer and django friendly ). I`ve just released the first ( and hopefully only ) release candidat

Re: Is it possible to output a graph from Matplotlib into Django like this?

2011-04-13 Thread nai
Thanks for your help. I went with 2 views, 1 for the image and 1 for the html. On Apr 12, 2:06 pm, Sam Walters wrote: > I mis-read this... basically you have one view and in the template you > are rendering you put HTML: > > > > > so that path will call your other views which return content as

Re: Password Auto-reset and Expiry Policy (every X Months)

2011-04-13 Thread gkuenning
On Apr 12, 6:47 am, Harish Tejwani wrote: > What would be the best module or app that can support > > a) User's Password expiring every 6 months, so they are forced to > change it Although Django supports it, I would STRONGLY discourage you from implementing such a policy. Password expiration

Re: can not download file from my site ( django + uwsgi )

2011-04-13 Thread Roberto De Ioris
Il giorno 12/apr/2011, alle ore 04.05, Lei Zhang ha scritto: > the static file is returned by nginx, and it is works well. > But the file returned by dynamic pages does't works very well. You have a pretty standard configuration. Check the uWSGI logs (they report the response size) to see wher

Re: Dajaxice and CSRF issues

2011-04-13 Thread Vincent den Boer
On Friday 08 of April 2011 13:37:53 Casey Greene wrote: > Can you change the request type from POST to GET? It sounds like this > is not a database modifying operation. > > Casey Yes, I could but the generated Dajaxice script doesn't give me the option to use a GET request. Perhaps I should jus

Re: New to Django-Installation problem

2011-04-13 Thread werefr0g
Are you using python 3? -- 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 unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more option

[JOB] Django/Python/HTML/JS Developer (Vienna, Austria)

2011-04-13 Thread Bernhard Schandl
Gnowsis.com, a Vienna-based hightech startup, are looking for a full- time or part-time Django/Python User Interface Developer (f/m) to extend their team in Vienna. You will work on an appealing user interface for http://www.getrefinder.com. Ideally you have the following technical skills: + Pyt

Re: Stackoverflow kind of Answer/commenting app in Django

2011-04-13 Thread Martin Pajuste
Are You aware of Django’s comments framework? http://docs.djangoproject.com/en/dev/ref/contrib/comments/ -- 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 unsubscribe from this

Re: Stackoverflow kind of Answer/commenting app in Django

2011-04-13 Thread AJ
I am kind of aware of that. I just want to add a Stackoverflow kind of a commenting system (with comments on answers and voting on answers) to my already present application. Does anyone know if Django's own comment app can be enhanced to be that or has anyone already done that? On Wed, Apr 13,

get_object_or_404 Tutorial part 3

2011-04-13 Thread darekodz
I've very strange error in part 3. I want to test using function get_object_or_404. I've 3 polls, so in that adress: http://localhost:8000/polls/1/ http://localhost:8000/polls/2/ http://localhost:8000/polls/3/ everything is OK. In that adress: http://localhost:8000/polls/4/ Should be exeptions 404.