Re: override a form field, to allow usernames with '@'

2010-05-03 Thread Felippe Bueno
Btw, I read about django don't accept @ in usernames, but I can create a User using User.create_user(m...@email.com, m...@email.com, mypassword) The only problem is, I can't save the user at admin site. I was thinking if the limitation is only at forms. I did not test the authentication yet. Any

Re: Django with Java

2010-05-03 Thread Daniel Fackrell
xpanta, I'm not sure about the rest of your question, but this page appears to have some good candidates for solving non-linear equations: http://wiki.python.org/moin/NumericAndScientific Daniel Fackrell / Intchanter On Sun, May 2, 2010 at 9:23 PM, xpanta wrote: > Hi, > >

Re: Atom Feed Publication Time Question

2010-05-03 Thread Mike Bader
I am not sure that this is the appropriate place to request assistance with the following question, but if anyone can either help me or direct me to an appropriate location for assistance, I would greatly appreciate help that anyone can provide. Thank you much, mike On May 3, 9:25 am, Mike

Re: Nesting model forms with admin

2010-05-03 Thread Matt Schinckel
On May 3, 8:23 am, Spaceman Paul wrote: > I can't find the ticket, Matt.  If you could forward me a link, or > just > dig that patch up for me, I'd greatly appreciate it. http://code.djangoproject.com/ticket/9025 I haven't looked at this much since November, so it may not

Re: QuerySet.distinct and aggregates

2010-05-03 Thread Wedg
Here's a real simplified version demonstrating what I was (poorly) trying to explain above: # models.py from django.db import models class Alpha( models.Model ): name = models.CharField(max_length=10, default='Alpha') def __unicode__( self ): return u'%s%s' % (self.name,

Re: Variable-length forms

2010-05-03 Thread Shawn Milochik
http://docs.djangoproject.com/en/1.1/topics/forms/formsets/ That ought to help out. 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-us...@googlegroups.com. To unsubscribe from this group,

Variable-length forms

2010-05-03 Thread Peter
Forgive the newbie question but I can't see anything in the docco on this: how do I create a form with a variable number of fields? The scenario is a situation where the user can buy a variable number of licences, and needs to enter information for each. Most of the information, product, email

Getting wrong arguments in a post_save handler

2010-05-03 Thread eka (Esteban)
Hi all, Django 1.1.1 My testcase was breaking cause my post_save handler wasn't receiving the proper arguments, after a couple of times using it I became dumbfounded when I found this for the post_save post_save = Signal(providing_args=["instance", "raw", "created"]) line 9

Re: Set field value for ChoiceField

2010-05-03 Thread Thomas Allen
The field was being set correctly, but my template did not show this until now for some reason. Thomas On May 3, 5:34 pm, Thomas Allen wrote: > If I'm instantiating a form, how do I set a ChoiceField value in it? > > I have a form with an attribute "role" which I am

Set field value for ChoiceField

2010-05-03 Thread Thomas Allen
If I'm instantiating a form, how do I set a ChoiceField value in it? I have a form with an attribute "role" which I am setting to the user's current role, like so: form = EditUserForm({ 'last_name': user.last_name, 'first_name': user.first_name, 'email': user.email, 'role':

Admin custom filters

2010-05-03 Thread Thales
Good evening, I am trying to create a custom filter in my admin. It should be in the general page Modify. If a put in the filter_list the content 'project__year', it shows me the years avaiable on the right menu and filters well. But I want to define the default value (the default year

Re: Decode a JSON object?

2010-05-03 Thread Thomas Allen
Thanks, I poked around some more and simplejson.loads() was what I needed. Thomas -- 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

filebrowser issue

2010-05-03 Thread Bobby Roberts
hey I have a strange issue. I was having trouble getting django- tinymce and filebrowser working. I've worked through all of the errors etc. In filebrowser, I can create a new directory, but when i try to upload a file or image, nothing happens... it acts like it's uploading but it's not on the

Re: Multiple Django versions on one server?

2010-05-03 Thread Dan Harris
virtualenv can be used with mod_wsgi, we are doing so on our production servers. see http://code.google.com/p/modwsgi/wiki/VirtualEnvironments for more information Cheers, Dan On May 3, 8:26 am, Stodge wrote: > I am aware of virtualenv, but can it be used with mod_wsgi. Time

Re: How to filter a query set based on a calculated date value?

2010-05-03 Thread Nuno Maltez
You can try the extra() method and write some SQL: http://docs.djangoproject.com/en/dev/ref/models/querysets/#extra-select-none-where-none-params-none-tables-none-order-by-none-select-params-none Something like (you'd need the correct functions for adding time and finding the current date for

Re: NoReverseMatch for authentication app views

2010-05-03 Thread Nuno Maltez
Can you access the django login view by typing the URL directly on the browser (http:///login/)? -- 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,

Re: Decode a JSON object?

2010-05-03 Thread Viet Le
Moreover, If you intend to use JSON on Google App Engine with django, simplejson is the only choice. No extra C libraries. Viet. On Tue, May 4, 2010 at 12:47 AM, thanos wrote: > Thomas > > Try: > > >>> import simplejson > >>>

Re: Decode a JSON object?

2010-05-03 Thread thanos
Thomas Try: >>> import simplejson >>> simplejson.loads('{"totalspace":243862.672,"freespace":94053.564}') {'freespace': 94053.5638, 'totalspace': 243862.671} >>> Although cjson is a lot faster, you should have simplejson if you are using Django. Thanos On May 3, 12:33 pm,

Decode a JSON object?

2010-05-03 Thread Thomas Allen
How can I parse a simple JSON object in Django? I would like to parse the response: {"totalspace": 243862.672,"freespace":94053.564} django.core.serializers.deserialize('json', packet) seems to have trouble parsing such a simple string. Thomas -- You received this message because you are

Re: Globally allow fields to be blank.

2010-05-03 Thread zinckiwi
> Very few of the fields in my models are required (in real life). But > the default attribute for a django field is that it is required. > > http://docs.djangoproject.com/en/1.1/ref/models/fields/#django.db.mod... > > Is there a way to toggle that, globally, so that I can just make the > few

Re: models as a package

2010-05-03 Thread Owen Nelson
Something I've seen that isn't particularly well documented (if at all)... If you have a model that isn't in your foo.models (ie, the top models.py for the app), and have a package setup, you need to add an app_name property to your model classes. Example myproject/ foo_app/ <-- needs to be

Atom Feed Publication Time Question

2010-05-03 Thread Mike Bader
All, I have a vexing question that I have not been able to solve when trying to use the Feeds framework in Django. Everything appears to work well, except when I subscribe to the feed in both Google Reader and Bloglines, the publication date comes up as the time that the feed was accessed. The

Re: Multiple Django versions on one server?

2010-05-03 Thread Stodge
I am aware of virtualenv, but can it be used with mod_wsgi. Time to do some reading. I have minimal control of the target cluster - I don't know yet if I'm allowed to have a user account; I doubt it. I think I hand off an RPM to the maintainers and they install it for me. Though the RPM is allowed

Re: Multiple Django versions on one server?

2010-05-03 Thread Kenneth Gonsalves
On Monday 03 May 2010 5:33:36 pm Stodge wrote: > We're about to deploy our Django app on our production Redhat cluster > using mod_wsgi, earlier than expected. We developed the app using > Django 1.2b1 because we wanted the multiple database support. > Unfortunately, the cluster uses Django 1.1.x.

Re: Multiple Django versions on one server?

2010-05-03 Thread Daniel Roseman
On May 3, 1:03 pm, Stodge wrote: > We're about to deploy our Django app on our production Redhat cluster > using mod_wsgi, earlier than expected. We developed the app using > Django 1.2b1 because we wanted the multiple database support. > Unfortunately, the cluster uses Django

Multiple Django versions on one server?

2010-05-03 Thread Stodge
We're about to deploy our Django app on our production Redhat cluster using mod_wsgi, earlier than expected. We developed the app using Django 1.2b1 because we wanted the multiple database support. Unfortunately, the cluster uses Django 1.1.x. What are the options for running two versions on

Re: Distinct Field

2010-05-03 Thread Thales
Thank you very much. It worked fine. On 3 maio, 07:50, "ge...@aquarianhouse.com" wrote: > Did you try: > > Projct.objects.all().values('year').annotate(count=Count('year')) > > On May 3, 12:45 pm, Thales wrote: > > > > > I tried > >

Re: Distinct Field

2010-05-03 Thread ge...@aquarianhouse.com
Did you try: Projct.objects.all().values('year').annotate(count=Count('year')) On May 3, 12:45 pm, Thales wrote: > I tried > Projct.objects.annotate(Count('year', distinct=True)) > > But it still returns all the rows... > > If I execute the raw SQL "select distinct(year)

Re: Distinct Field

2010-05-03 Thread Thales
I tried Projct.objects.annotate(Count('year', distinct=True)) But it still returns all the rows... If I execute the raw SQL "select distinct(year) from project" it works fine, but I dont think its very elegant... On 3 maio, 07:31, "ge...@aquarianhouse.com" wrote: > To

Re: Distinct Field

2010-05-03 Thread ge...@aquarianhouse.com
To use distinct in this context is not a good idea. Better use aggregate and count the years. http://docs.djangoproject.com/en/dev/topics/db/aggregation/#generating-aggregates-over-a-queryset On May 3, 12:27 pm, Thales wrote: > Hi everybody, > > I have a model called

Distinct Field

2010-05-03 Thread Thales
Hi everybody, I have a model called "Project" with the field "year". I have something about 1200 rows all of them with the year value "2010". But, I'll start adding projects for other years. I want to show the years that has projects, now it should just be: 2010 I am trying to do this: p =

Re: error in urls.py

2010-05-03 Thread Daniel Roseman
On May 3, 8:27 am, andy saksena wrote: > Hi > > my urls.py is > > from django.conf.urls.defaults import * > > # Uncomment the next two lines to enable the admin: > from django.contrib import admin > admin.autodiscover() > > urlpatterns = patterns(”, > # Example: > #

error in urls.py

2010-05-03 Thread andy saksena
Hi my urls.py is from django.conf.urls.defaults import * # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns(”, # Example: # (r’^/’, include(‘.foo.urls’)), (r’^accounts/’,

Re: Form with ChoiceField that collects additional info with each choice

2010-05-03 Thread derek
On Apr 30, 4:00 pm, gsnyder2007 wrote: > I'm looking for a pointer to sample code or advice regarding what is > the best way to build a form that allows the user to select from > several options and supply additional textual input that is associated > with the option they