Re: Please find it in your hearts to expose filter_or_exclude at a global level.

2011-04-12 Thread bruno desthuilliers
On 12 avr, 02:26, "sh...@bogomip.com" wrote: > Strange, I must have replied to the author only. > > It seems as though I was a goof and after looking through the source I > discovered how the model manager handles functions for the queryset. > > xyz.objects.get_query_set()._filter_or_exclude(...)

Creating REST APIs in Django...advice

2011-04-12 Thread Mazery Smith
Hello, So can anyone here recommend some REST packages/tools you use with Django and have a good experience with? I'm interested to know b/c it seems like most of the popular RESTful Django projects really stopped being very active around mid-2008. I'm wondering if that's because most people just

Re: Creating REST APIs in Django...advice

2011-04-12 Thread Massimiliano della Rovere
https://bitbucket.org/jespern/django-piston/wiki/Home skype: masdero, icq: 473891447, yim: mas_dero, msn: mas_d...@hotmail.com Mi scriva in italiano; Write me in English; Skribu al mi Esperante! On Tue, Apr 12, 2011 at 10:07, Mazery Smith wrote: > Hello, > So can anyone here recomm

Reusing a code snippet

2011-04-12 Thread Sithembewena Lloyd Dube
Hi all, I found a code snippet to fix a dumplicvated first page of paginated results and was wondering if anybody knows where in the code it should be implemented? It looks like something that should be in views.py to me, but I'd like others' input The code snippet is here: http://djangosnippet

Re: Reusing a code snippet

2011-04-12 Thread Daniel Roseman
On Tuesday, April 12, 2011 10:44:27 AM UTC+1, Lloyd Dube wrote: > > Hi all, > > I found a code snippet to fix a dumplicvated first page of paginated > results and was wondering if anybody knows where in the code it should be > implemented? > > It looks like something that should be in views.py t

Re: Reusing a code snippet

2011-04-12 Thread Sithembewena Lloyd Dube
Hi Daniel, Thanks. I would think that plugging about in the default django installation would not be good practice - can that file simply reside in the project directory and the name in settings.py MIDDLEWARE_CLASSES becomes 'myproj.filename', ? My colleague has so far added the middleware to the

Re: Reusing a code snippet

2011-04-12 Thread Daniel Roseman
On Tuesday, April 12, 2011 11:17:15 AM UTC+1, Lloyd Dube wrote: > > Hi Daniel, > > Thanks. I would think that plugging about in the default django > installation would not be good practice - can that file simply reside in the > project directory and the name > in settings.py MIDDLEWARE_CLASSES be

Creating REST APIs in Django...advice

2011-04-12 Thread Tom Christie
I've been working on this with some folks: http://django-rest-framework.org Released 0.1 a few weeks ago, and it's coming along *really* nicely. It's under v active development ATM. The auto-generated API browser is particularly cool. Really would advise anyone taking a look at building web API

Re: Reusing a code snippet

2011-04-12 Thread Sithembewena Lloyd Dube
Thanks Daniel :) On Tue, Apr 12, 2011 at 12:20 PM, Daniel Roseman wrote: > On Tuesday, April 12, 2011 11:17:15 AM UTC+1, Lloyd Dube wrote: >> >> Hi Daniel, >> >> Thanks. I would think that plugging about in the default django >> installation would not be good practice - can that file simply resid

Re: syncdb just hangs/tutorial

2011-04-12 Thread nishant kashyap
Check out once properly yor connection(Host, username,password,port) in setting.py On Apr 11, 6:08 pm, L Corbani wrote: > I am new to django, and am running the tutorial.  I have edited > 'settings.py' and am running "python manage.py runserver". > > When I run the server and then call "python

install admin-files

2011-04-12 Thread Massimo
Hi all, I'm trying to install django-adminfiles, but I have some difficulty understanding a passage: To use django-adminfiles in your Django project: 1) Add 'adminfiles' to your INSTALLED_APPS setting. 2) Make the contents of the adminfiles/media/adminfiles directory available at MEDIA_URL/admin

Navigation menu

2011-04-12 Thread Daniel Gerzo
Hello all, I was wondering how do you generate the navigation menu in your web sites, with a possibility to mark up the "active" page? My searching revealed some solutions, most of them based on implementing a custom template tag and then parsing the request.path. I was wondering whether som

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

2011-04-12 Thread JustinMarsan
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 do that ? I was thinking of making sure the bot is aut

Can give each user a specific folder to upload to using an ImageField?

2011-04-12 Thread Thomas Weholt
I see from the docs that ImageField takes an param called upload_to. I want to put uploaded files into a specific folder for that specific user uploading the image. And the target folder is NOT in the media root. Any tips on how to achieve that? -- Mvh/Best regards, Thomas Weholt http://www.wehol

Re: Creating REST APIs in Django...advice

2011-04-12 Thread Brian Bouterse
I've been reading through the documentation for piston and django-rest-framework.org and they both look like great projects. Could anyone with experience working with either of these applications (or their authors themselves) provide some compare and contrasting of the features/usability/etc. Als

Re: makemessages failing to extract all strings from Javascript

2011-04-12 Thread Ned Batchelder
Django's Javascript message parsing is fragile. The full details are here: http://nedbatchelder.com/blog/201104/a_javascript_lexer_in_python_and_the_saga_behind_it.html I've written a patch and attached it to ticket 7704, http://code.djangoproject.com/ticket/7704. I was hoping to get it into

Re: Navigation menu

2011-04-12 Thread emonk
jquery? 2011/4/12 Daniel Gerzo > Hello all, > > I was wondering how do you generate the navigation menu in your web sites, > with a possibility to mark up the "active" page? > > My searching revealed some solutions, most of them based on implementing a > custom template tag and then parsing the

Re: Navigation menu

2011-04-12 Thread Derek
On Apr 12, 11:33 am, Daniel Gerzo wrote: > Hello all, > > I was wondering how do you generate the navigation menu in your web > sites, with a possibility to mark up the "active" page? > > My searching revealed some solutions, most of them based on implementing > a custom template tag and then pars

Re: Can give each user a specific folder to upload to using an ImageField?

2011-04-12 Thread urukay
yes, this how you can upload image or whatever file to folder outside MEDIA..it uploads to PRIVATE_ROOT/... This is simple version of Image model in my project: from django.core.files.storage import FileSystemStorage from contrib.models.fields import CustomFileField fs = FileSystemStorage(locati

Re: Advice: project hosting apps

2011-04-12 Thread Derek
On Apr 11, 3:50 pm, Peter Herndon wrote: > Thanks very much for the advice, all!  I greatly appreciate it. > > ---Peter > On Apr 4, 2011, at 9:25 AM, Peter Herndon wrote: > > > > > > > > > Hi all, > > > I'm tasked to build an internal project hosting site similar to Github > > or Bitbucket for my

Re: Navigation menu

2011-04-12 Thread Andy Mikhailenko
Hello Daniel, I think you really need to provide your definition of "nicer" to get useful feedback. For instance, my implementation of breadcrumbs[1] indeed introduces a custom template tag and I haven't the slightest idea what are the use cases where this approach would not be natural. [1] http

Re: Advice: project hosting apps

2011-04-12 Thread Cal Leeming [Simplicity Media Ltd]
Why don't you try GitHub:FI? It's basically a github install on your own appliance in your office.. On Tue, Apr 12, 2011 at 3:21 PM, Derek wrote: > On Apr 11, 3:50 pm, Peter Herndon wrote: > > Thanks very much for the advice, all! I greatly appreciate it. > > > > ---Peter > > On Apr 4, 2011, a

Re: Advice: project hosting apps

2011-04-12 Thread dave b
There is also http://gitorious.org/ - it is ROR, but it is agpl. -- 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+unsu

Re: Creating REST APIs in Django...advice

2011-04-12 Thread sebastien piquemal
Well ... http://django-rest-framework.org allows you to override the method by adding a post parameter. So in your form, you just add a hidden input or and django-rest-framework will pipe your POST request into the "put" handler or "delete" handler. Of course name="_method" can be configured

Re: Creating REST APIs in Django...advice

2011-04-12 Thread Brian Bouterse
This is an interesting approach I had not thought of before. Thanks! Agreed, CRUD is not the same as REST. Brian On Tue, Apr 12, 2011 at 10:51 AM, sebastien piquemal wrote: > Well ... http://django-rest-framework.org allows you to override the > method by adding a post parameter. So in your f

Admin Interface Super User Not Logging In

2011-04-12 Thread Johan
I have just installed the newest version of django from the source repo. I added the admin app, did the synchdb (as part of this I created the admin user), then i started the test server. Then I browsed to the admin login page and enter the admin user and the correct password. I get told that the

admin inline formset using incorrect form

2011-04-12 Thread shanyu
Hi, please take a look at the following code. def create_foo_form(baz): class FooForm(forms.ModelForm): def __init__(self, *args, **kwargs): print "Initializing a FooForm object" # Init stuff here return FooForm class FooInline(admin.TabularInline): model

Re: Navigation menu

2011-04-12 Thread javatina
You can put your current menu option in context and then, while rendering pages, check for it and use a different style for the active menu option. On Apr 12, 5:33 am, Daniel Gerzo wrote: > Hello all, > > I was wondering how do you generate the navigation menu in your web > sites, with a possibil

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

2011-04-12 Thread Aryeh Leib Taurog
On Apr 11, 1:21 pm, nai wrote: > Is there anyway I can return the image like this `return > render_to_response('template.html', {'graph': matplotlib or some other graphing package>}` As noted, images are almost always loaded independently. See, for example, "Definition and Usage" of img tag her

Activating HTML error emails while keeping logger defaults

2011-04-12 Thread Carsten Fuchs
Hi all, from the documentation at I get that I need something like LOGGING = { 'version': 1, 'handlers': { 'mail_admins': { 'level': 'ERROR', 'class': 'django.utils.log.AdminEmailHandler',

Re: Navigation menu

2011-04-12 Thread Jason Culverhouse
There is a snippet http://djangosnippets.org/snippets/1729/ "Template tag to handle navigation item selection" which is quite useful for creating navigation/menu structure Jason On Apr 12, 2011, at 11:43 AM, javatina wrote: > You can put your current menu option in context and then, while > rende

Re: Error: No module named mysql.base when trying to sync.db

2011-04-12 Thread dsx
same here. On Apr 1, 12:48 am, nai wrote: > I posted the same question on stackoverflow > here:http://stackoverflow.com/questions/5509755/problem-with-django-syncdb... > > Reproduced > > Hi all, I'm trying to deploy my project on my EC2 instance. When I run > python manage.py validate I get this

__unicode__ in tutorial part 1

2011-04-12 Thread darekodz
I'm using instant django which have: Python 2.7.1 and Django 1.2.4. When I add def __unicode__(self): return self.question and def __unicode__(self): return self.choice to my class I have errors when I want to restart shell, like: C:\django\mysite>python manage.py syncd

Re: __unicode__ in tutorial part 1

2011-04-12 Thread Jirka Vejrazka
> IndentationError: unexpected indent > > I don't know what's wrong - Can You help me? It's exactly what it says - indentation is important in Python and number for spaces (or tabs) on that line does not match the rest of your file. Or you mixed tabs and spaces. HTH Jirka -- You received

Re: __unicode__ in tutorial part 1

2011-04-12 Thread Rafael Durán Castañeda
I think last line from traceback is enough: IndentationError: unexpected indent 2011/4/12 darekodz > I'm using instant django which have: Python 2.7.1 and Django 1.2.4. > When I add > >def __unicode__(self): >return self.question > > and > >def __unicode__(self): >return

Re: __unicode__ in tutorial part 1

2011-04-12 Thread Abhijeet Rastogi
May be you have copy-pasted the code from somewhere. May be you are using a TAB instead of 4-spaces or the other way round. Its a python question. You should brush-up your python skills before getting to django. Start with a book like "dive into python". On Wed, Apr 13, 2011 at 1:15 AM, darekodz

New to Django-Installation problem

2011-04-12 Thread prem
Hi, Im trying to install Django but get an error while installing..Its a window installation.. I have downloaded the Django files and when I tried to install I get the following error. C:\>cd django C:\Django>cd django-1.3 C:\Django\Django-1.3>setup.py install File "C:\Django\Django-1.3\set

Re: [JOB] Python/Django Developer, NYC

2011-04-12 Thread Cal Leeming [Simplicity Media Ltd]
Hi, If you aren't able to find anyone local to you within the time frame specified, and would consider doing this remotely (as I reside in the UK), then feel free to give me a shout. We don't yet have a company website up, simply because the majority of our clients come from word of mouth referral

Re: New to Django-Installation problem

2011-04-12 Thread Shawn Milochik
Try replacing this: C:\Django\Django-1.3>setup.py install with this: C:\Django\Django-1.3>python setup.py install 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.co

Re: __unicode__ in tutorial part 1

2011-04-12 Thread darekodz
It works!! THANK YOU EVERYBODY On 12 Kwi, 22:21, Rafael Durán Castañeda wrote: > I think last line from traceback is enough: > > IndentationError: unexpected indent > > 2011/4/12 darekodz > > > > > > > > > I'm using instant django which have: Python 2.7.1 and Django 1.2.4. > > When I add > > >

python manage.py reset contenttypes doesnt work with mysql 5.5.1 Works with 5.1

2011-04-12 Thread David Markey
Simple django setup, when I try to reset contenttypes app, just after doing a syncdb.. python manage.py reset contenttypes You have requested a database reset. This will IRREVERSIBLY DESTROY any data for the "contenttypes" application in the database "my_test". Are you sure you want to do this?

Re: Stackoverflow kind of Answer/commenting app in Django

2011-04-12 Thread AJ
Isn't there any app with just the commenting part? I mean the answer and comments on those answers part only. -- 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 fro

Re: Creating REST APIs in Django...advice

2011-04-12 Thread Tom Christie
  The obvious big difference with REST framework is that the API is entirely web browse-able. To me that's quite a big deal - your API can be genuinely self documenting, and it's massively easier to browse, work with, and debug, than it would be if your working from the command line all the time

Re: [JOB] Python/Django Developer, NYC

2011-04-12 Thread Cal Leeming [Simplicity Media Ltd]
My apologies to the list, the below reply was meant to have been directly to the OP. Cal. On Tue, Apr 12, 2011 at 9:48 PM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > Hi, > > If you aren't able to find anyone local to you within the time frame > specified,

Re: [JOB] Python/Django Developer, NYC

2011-04-12 Thread Kenneth Gonsalves
On Tue, 2011-04-12 at 21:48 +0100, Cal Leeming [Simplicity Media Ltd] wrote: > If you aren't able to find anyone local to you within the time frame > specified, and would consider doing this remotely (as I reside in the > UK), I think you sent this to the list by mistake -- regards KG http://law

Re: [JOB] Python/Django Developer, NYC

2011-04-12 Thread Kenneth Gonsalves
On Wed, 2011-04-13 at 07:01 +0530, Kenneth Gonsalves wrote: > On Tue, 2011-04-12 at 21:48 +0100, Cal Leeming [Simplicity Media Ltd] > wrote: > > If you aren't able to find anyone local to you within the time frame > > specified, and would consider doing this remotely (as I reside in > the > > UK),

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

2011-04-12 Thread Graeck
Hi all, Just looking for input ... tips, suggestions, etc. We have an old web app written in C using CGIs. All the html is generating in the C code using print statements. It's become almost impossible to do anything other than make very minor UI changes due to the complexity of the code and the