authentication/registration state of the art

2012-05-09 Thread Dan Ancona
Hi django-users - Long time fan and ardent proponent of django; I finally joined this list and this is my first time posting. Hi! For the last few years I've been working on a django-based project called Democracy Dashboard; essentially it's the embryonic beginning of a replacement for all the

Re: how to get text of a ChoiceField populated with ajax

2012-05-09 Thread HDayi
hi Kurtis and Frances after populating the ChoiceField it looks like this First Second at first values were number but django form returns the value for this ChoiceField after validation. I don't have a clean_teacher method because i don't know what to do. i think the probl

Re: how to get text of a ChoiceField populated with ajax

2012-05-09 Thread HDayi
hi again, finally i have solved the problem. I have found a web page saying you must create a custom choiceField class with a custom validation method. so i did that. http://blog.ikraftsoft.com/post/1342312823/django-form-choicefield-dynamic-values thx -- You received this message because yo

new to django - just need pages

2012-05-09 Thread Claire Watkins
Hi, I'm new to django, python etc so i've ran through the django tutorial and it seemed to make sense. I'm on creating my first website and i've managed to create a project and get the admin site up and running. Now all i need to do is create 3 pages "Home", "About", and "Maps". I downloaded the d

Re: Filter by retirement age?

2012-05-09 Thread Tom Evans
On Wed, May 9, 2012 at 12:12 AM, Lachlan Musicman wrote: > Hola, > > I have a model Person with a dob = models.DateField() > > I would like to filter by age - in particular only include people less than > 60 years old. > > I am having no luck getting the syntax right and was looking for pointers?

Re: Generic Views with flair?

2012-05-09 Thread sbrandt
There is another way: Class Based View decorators: http://djangosnippets.org/snippets/2668/ -- 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

Model reversion

2012-05-09 Thread Alireza Savand
Hi First of all i know there is a plugable app called *django-reversion*, leave it now! I like to discus about some idea to implement a simple reversion app. i have couple of thoughts about it, all i need is just another people's ideas about it. If i'm wrong correct me! The model that used to

Re: how to get text of a ChoiceField populated with ajax

2012-05-09 Thread Kurtis Mullins
Hey, It would help a lot to see your code posted to dpaste.com or somewhere. As far as grabbing the choices in your clean method, here's a little copy-and-paste from Django's own ChoiceField so you can see how they do it: class ChoiceField(Field): > > widget = Select > > default_error_mes

__contains, ok but contains how many ;-) ?

2012-05-09 Thread Guillaume Florent
Hi everybody, I would like to know if there if a simple way to know how many times a given field contains a string. e.g. Note.objects.filter(notedescription__contains='keyword') What would be the recommended way to know how many times 'keyword' is hit in the 'notedescriptiont' field? Do I have have

Re: limit row in change view

2012-05-09 Thread Nenad Cikic
I have managed to solve it by myself so reporting here if anyone is interested. I have checked and the sql Log shows statements are generated with LIMIT clause (postgre). You have to subclass the ChangeList class ass class MyChangeList(ChangeList): def get_query_set(self): return supe

Re: __contains, ok but contains how many ;-) ?

2012-05-09 Thread Jani Tiainen
Hi, There is no way to do that in a pure Django ORM, so only option is to fall back to raw SQL. The exact SQL syntax is dependent on your database backend but Django can still get you real model instances. See more about raw SQL at https://docs.djangoproject.com/en/dev/topics/db/sql/ Though if yo

Setting current timezone in Django 1.4, and middleware

2012-05-09 Thread peppergrower
In 1.4, what exactly is the scope of the current timezone? In other words, if I use activate() to set a current timezone, is that global? Or does it only apply to the current request (and not persist across requests)? Or, some other scope? (I looked at the source

New Install - django-admin.py ... just gives contest/options but doesn't run?

2012-05-09 Thread Robert G
When I type d:\myproj>django-admin.py startproject mysite or d:\myproj>django-admin.py test or any of the subcommands, I get this message: Usage: django-admin.py subcommand [options] [args] Options: -v VERBOSITY, --verbosity=VERBOSITY Verbosity level; 0=minimal output,

Re: Model reversion

2012-05-09 Thread francescortiz
Json and difflib won't work well together, unless you make a diff per field, which will add overhead. Look at http://stackoverflow.com/questions/4599456/textually-diffing-json Reverting is returning to a previous state. Just run all diffs from the first commit until you reach the desired state.

Django Wizard - custom queryset depending of the previous step

2012-05-09 Thread Solvik
Hi everyone, It's the first time I post here as I've always search everything before posting, but this time I'm losing my head :) I'm using for the first time the django Wizard Form feature. It looks awesome ! As I need to change the queryset depending of the result of the previous form step

Re: New Install - django-admin.py ... just gives contest/options but doesn't run?

2012-05-09 Thread Daniel Roseman
On Wednesday, 9 May 2012 18:34:41 UTC+1, Robert G wrote: > > > I can't seem to find much about this error online - any suggestions? On the contrary, this is very much a FAQ. Your Windows installation is set to run scripts against Python, but without passing any arguments. Easiest way to fix it

Add UserProfile Inline in the change_View function

2012-05-09 Thread bvcelari
Hello, I´m trying to custom admin in django 1.4. I went to docs, followed the instructions, and worked. The issue comes when I try to modify change_view, and find that inlines does not work inside change_view function. My target is be able to allow users to change only their username (from Use

Re: New Install - django-admin.py ... just gives contest/options but doesn't run?

2012-05-09 Thread Robert G
Awesome, thought I tried this but apparently not. I had to use d:\myproj>python d:/Python27/Scripts/django-admin.py startproject mysite to make it work, but it worked so yay! On with the tutoral I go! On May 9, 3:59 pm, Daniel Roseman wrote: > On Wednesday, 9 May 2012 18:34:41 UTC+1, Robert G w

Re: Filter by retirement age?

2012-05-09 Thread Lachlan Musicman
Thanks Tom, but I get an error because timedelta doesn't take years - I've changed it to weeks=3120 and it works. Because of that error I've also found another thread discussing the issue: http://stackoverflow.com/questions/765797/python-timedelta-in-years I liked the most popular answer's stand

Re: Filter by retirement age?

2012-05-09 Thread Lachlan Musicman
Thanks Nikolas - that works. cheers L. On Wednesday, May 9, 2012, Nikolas Stevenson-Molnar wrote: > On your second attempt, the problem is that you are trying to call the > datetime module, not the datetime class. Change it to > datetime.datetime(...) and you should be fine there. > > _Nik > >

Documentation for the url template tags in 1.4

2012-05-09 Thread Greg Nicholas
Correct me if I'm wrong, but I think 1.4's documentation has jumped the gun in describing the url template tag's syntax. According to 1.4's documentation : {% url 'path.to.some_view' v1 v2 %} >> > The first argument is a path to

Re: Documentation for the url template tags in 1.4

2012-05-09 Thread Russell Keith-Magee
Hi Greg, Thanks for the report. From the look of it, the problem is actually with Django's documentation site, not with the documentation itself. If you look at the raw source file for the documentation in 1.4: https://github.com/django/django/blob/stable/1.4.x/docs/ref/templates/builtins.txt#L1

Search in Django

2012-05-09 Thread Lachlan Musicman
Hi, I want to implement search in my django project. Looking around, I see lots about Haystack. I looked at Whoosh for the backend, but then I saw a tutorial for Djapian/Xapian that made the whole thing look dead simple. Also, since then I've discovered that Whoosh is lightweight and while the

Re: Documentation for the url template tags in 1.4

2012-05-09 Thread Greg Nicholas
Great, thanks for looking into it! On Wednesday, May 9, 2012 9:27:08 PM UTC-4, Russell Keith-Magee wrote: > > Hi Greg, > > Thanks for the report. From the look of it, the problem is actually > with Django's documentation site, not with the documentation itself. > > If you look at the raw source

Google Drive with Django?

2012-05-09 Thread Jordon Wing
Hey guys, I'm trying to integrate Google Drive into my app, and I'm having some trouble using OAuth2. I'm not sure if any of you have played with the SDK, but if anyone has, what library (if any) did you use? Is there anything that simplifies the 200+ lines of code they have in the examples? L

Re: Google Drive with Django?

2012-05-09 Thread Alec Taylor
This isn't helpful? https://developers.google.com/drive/examples/python On Thu, May 10, 2012 at 2:16 PM, Jordon Wing wrote: > Hey guys, > I'm trying to integrate Google Drive into my app, and I'm having some trouble > using OAuth2. I'm not sure if any of you have played with the SDK, but if >

Apache does not display a flash file

2012-05-09 Thread atul khairnar
Hi, Recently I deployed my django project on Apache using mod_wsgi. Everything is working perfect except flash. The flash (.swf file) did not render on the client's browser but it works perfect while hosting on django built-in development server. What may be the problem? I am using Ubuntu : 11.0

Re: Model reversion

2012-05-09 Thread Alireza Savand
Thanks for your reply and the link. But what about binary items, i mean files. should we keep eyes on them, and if user delete them we should not delete them and just hide them? Or reversion is just about text and text ? And something else, reversion model shoulda trace the creator of the chang

Re: Search in Django

2012-05-09 Thread Alireza Savand
Haystack is highly recommended! I can't give you helpful advice to guide you which backend is lighter, because i using it with Solr and it was/is prefect! But you can compare the backends itself to find-out which one is lighter to use. And i think by simple you mean a full-text search engine with

Re: New Install - django-admin.py ... just gives contest/options but doesn't run?

2012-05-09 Thread Jani Tiainen
10.5.2012 0:46, Robert G kirjoitti: Awesome, thought I tried this but apparently not. I had to use d:\myproj>python d:/Python27/Scripts/django-admin.py startproject mysite to make it work, but it worked so yay! On with the tutoral I go! On May 9, 3:59 pm, Daniel Roseman wrote: On Wednesday,