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 chose, e.g.
>
> choices =
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/’, include(‘registration.backends.default
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:
> # (r’^/’, include(‘.foo.u
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 = Proje
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 "Project" with the field "y
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 use distinct in this conte
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) from project" it works
>
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
> > Projct.objects.annotate(Count('year', distinct=True))
>
> > But
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 Django
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 1.1.x. What are th
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.
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
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 u
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 in
> 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 truly
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 subsc
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, Thom
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
> >>> simplejson.loads('{"totalspace":243862.672,"freespace":94053.564}')
>
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,
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 you
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 to do
> some readi
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
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
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 selected)
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': user.get_profi
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 setting to the
> user's curre
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 django.db.models.sig
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 ad
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, sen
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, self.id
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 be that
useful.
Matt.
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 Bader
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,
>
> There is a project in
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 o
34 matches
Mail list logo