Re: Django Games

2010-11-24 Thread vbs
That's what I am going to do. But a little different. On Thu, Nov 25, 2010 at 1:02 PM, Detectedstealth wrote: > Has anyone ever used django to allow people to add games to there site > like facebook has? > > So allow them to create an application, generate the api key's,

Re: mod_wsgi and _imaging C module

2010-11-24 Thread Graham Dumpleton
On Nov 25, 11:41 am, Stranger wrote: > Hi all, > I've got problem when trying to run my first django project through > apache/mod_wsgi. > After proper vhost configuration has been done and I ran my app and > got this: > > Caught ImportError while rendering: The

Django Games

2010-11-24 Thread Detectedstealth
Has anyone ever used django to allow people to add games to there site like facebook has? So allow them to create an application, generate the api key's, then load there game into an iframe. -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: percentage of models given field value?

2010-11-24 Thread Christophe Pettus
On Nov 24, 2010, at 8:13 PM, Lachlan Musicman wrote: > Thanks Christopher. I've never done raw SQL in Django before. This may > seem like a silly follow up question, but is it standard practice to > put the relevant code, as described by the documentation >

Re: percentage of models given field value?

2010-11-24 Thread Christophe Pettus
On Nov 24, 2010, at 8:13 PM, Lachlan Musicman wrote: > Thanks Christopher. I've never done raw SQL in Django before. This may > seem like a silly follow up question, but is it standard practice to > put the relevant code, as described by the documentation >

Re: percentage of models given field value?

2010-11-24 Thread Lachlan Musicman
On Thu, Nov 25, 2010 at 13:44, Christophe Pettus wrote: > > On Nov 24, 2010, at 4:37 PM, Lachlan Musicman wrote: >> Using django 1.2 I wanted to present some statistics on the data that >> we have been collecting in our db. >> >> We have source texts with authors, and target

mod_wsgi and _imaging C module

2010-11-24 Thread Stranger
Hi all, I've got problem when trying to run my first django project through apache/mod_wsgi. After proper vhost configuration has been done and I ran my app and got this: Caught ImportError while rendering: The _imaging C module is not installed I googled a lot around this problem and found that

'is None' in {% if %}

2010-11-24 Thread Christophe Pettus
I have a Decimal field that's blank=True, null=True, and NULL and 0.0 are distinct values. I'd like to do something different in a template depending on whether or not the value is None or not, but a standard {% if field %} treats 0.0 and None the same. Right now, I'm checking is None in the

Re: percentage of models given field value?

2010-11-24 Thread Christophe Pettus
On Nov 24, 2010, at 4:37 PM, Lachlan Musicman wrote: > Using django 1.2 I wanted to present some statistics on the data that > we have been collecting in our db. > > We have source texts with authors, and target texts with their translators. > > The target text model has a value "Language". >

Re: newbie admin question

2010-11-24 Thread eric
Well, there are a number of models, so I'll just give an example of the one that is misbehaving: from pages.models import Chapter from django.contrib import admin class CharacterInline(admin.StackedInline): model = Character class CharacterAdmin(admin.ModelAdmin): inlines =

percentage of models given field value?

2010-11-24 Thread Lachlan Musicman
Hola, Using django 1.2 I wanted to present some statistics on the data that we have been collecting in our db. We have source texts with authors, and target texts with their translators. The target text model has a value "Language". I get the count of the target texts: all, and then filtered

Re: absolute url in template and url name

2010-11-24 Thread ryan west
if you have a view let's say views.activate that corresponds to the URL at let's say /account/activate/2, you can use the template tag {% url views.activate params_for_url_capturing %} Cheers On Nov 24, 8:01 am, robos85 wrote: > Hi, > I'm writing an email sending module based

Re: How to set individual cache items so they don't timeout?

2010-11-24 Thread Ryan
I'll answer my own question: The way to do this is probably to write your own cache backend that is a wrapper around the django versions so that timeout values of 0 are handled the way you'd like. Johnny Cache does this: http://packages.python.org/johnny-cache/ "The custom backend setting

Re: absolute url in template and url name

2010-11-24 Thread Jumpfroggy
I always do something like this: abs_activate_url = request.build_absolute_uri(reverse('account_activate', args=user.id)) That's an absolute URL, so it's like "http://domain.com/account/ activate/2" instead of the normal reverse() or {% url %} which gives a relative URL like

Reloading a single model object from .py file... keeps getting cached results?

2010-11-24 Thread Jumpfroggy
I want to run a script outside of the django server for maintenance purposes, but it still accesses some of the models. The problem is that I can't seem to get the model object to reload it's data from the DB - it always seems cached. # Setup django. import project.settings from

Re: auth_user first_name and last_name editing

2010-11-24 Thread Scott Gould
A simple custom ModelForm should do the trick: from django.contrib.auth.models import User class UserChangeForm(forms.ModelForm): class Meta: fields = ('first_name', 'last_name',) model = User On Nov 24, 1:33 pm, BozoJoe wrote: >

Re: newbie admin question

2010-11-24 Thread Jason Mayfield
Can you provide your admin.py file? - Jason -- 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

newbie admin question

2010-11-24 Thread eric
While I've been using python for years, I'm new to django and I've found myself puzzled about something. I created my models and then activated the admin app, which is cool. I really like how sophisticated the admin system is out of the box. However, when I went to organize fields using the

auth_user first_name and last_name editing

2010-11-24 Thread BozoJoe
HI, I'm using django-registration and django-profiles to handle user creation and adding additional profile fields. However I'm at a lost as to how to allow the user to create/edit their first_name and last__name in the auth_user table? Do I need to do custom work to get a form for the user to

Problems to use django-treebeard

2010-11-24 Thread Rogério Carrasqueira
Hi! I'm having some problems on use django-treebeard to work with trees. I don't know why, but after update my django version from 1.2.1 to 1.2.3, the django-treebeard cannot insert a third node on a branch with 2 nodes already registered. It appears this error, when I use the method add_child().

Re: In-memory sorting of a QuerySet, yielding a QuerySet

2010-11-24 Thread Christophe Pettus
On Nov 24, 2010, at 12:25 AM, bruno desthuilliers wrote: > Err... Would you mean, something like a ChoiceField ?-) Very, very much like a ChoiceField. :) -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Sample Auto Log Out Code

2010-11-24 Thread Daniel Roseman
On Nov 24, 4:23 pm, octopusgrabbus wrote: > Sorry for the late reply. Most of my users will not remember to log > out. After, say four hours, I'd like to log them out, if of course > they're not already logged out. That's just a matter of setting session cookies to

Re: Sample Auto Log Out Code

2010-11-24 Thread octopusgrabbus
Sorry for the late reply. Most of my users will not remember to log out. After, say four hours, I'd like to log them out, if of course they're not already logged out. On Nov 5, 4:31 am, Daniel Roseman wrote: > On Nov 3, 12:43 pm, octopusgrabbus

django ticket tracking

2010-11-24 Thread felix
The django ticket system regards everything as spam. There doesn't seem to be a way to get a password reset. I created a new account, verified it, but the username/password or the email/password still do not work to login. anybody have any advice as to what to do now ? -- You received this

django bug with __iexact

2010-11-24 Thread felix
from django.contrib.auth.models import * User.objects.filter(username__iexact="/turtle") *** ValueError: list.index(x): x not in list URL: http://code.djangoproject.com/svn/django/trunk Repository Root: http://code.djangoproject.com/svn Repository UUID: bcc190cf-cafb-0310-a4f2-bffc1f526a37

Re: absolute url in template and url name

2010-11-24 Thread Jason Mayfield
On Nov 24, 2010, at 9:08 AM, robos85 wrote: > What do You mean "current Site object"? from django.contrib.sites.models import Site current_site = Site.objects.get_current() email_vars = Context({'registration_hash' : '123456', 'new_email' : 'm...@mail.com',

Re: absolute url in template and url name

2010-11-24 Thread robos85
I managed to render it properly: html_template = loader.get_template('emails/confirm_account.html') email_vars = Context({'registration_hash' : '123456', 'new_email' : 'm...@mail.com'}) What do You mean "current Site object"? On 24 Lis, 14:34, Jason Mayfield

Re: How can I set a flatpage to be my homepage?

2010-11-24 Thread mongoose
Hi Jason, That fixed everything. Thanks On Nov 24, 3:32 pm, Jason Mayfield wrote: > Is there a reason you are adding the flatpages to your urls.py rather than > using the FlatpageFallbackMiddleware, as specified in the docs? > >

Re: absolute url in template and url name

2010-11-24 Thread Jason Mayfield
Pass the current Site object into the template as part of the context. Then you can do: {{ current_site.domain }}{% url account_activation %} for the absolute url. On Nov 24, 2010, at 8:16 AM, robos85 wrote: > small correction not {{ url }} but {% url %} ? > > On 24 Lis, 14:01, robos85

Re: How can I set a flatpage to be my homepage?

2010-11-24 Thread Jason Mayfield
Is there a reason you are adding the flatpages to your urls.py rather than using the FlatpageFallbackMiddleware, as specified in the docs? http://docs.djangoproject.com/en/1.2/ref/contrib/flatpages/#installation On Nov 24, 2010, at 8:23 AM, mongoose wrote: > OK further updates. > > I updated

Re: How can I set a flatpage to be my homepage?

2010-11-24 Thread mongoose
OK further updates. I updated my URLs to have the following. urlpatterns += patterns('', (r'', 'django.views.generic.simple.direct_to_template', {'template': 'flatpages/default.html'}), ) This now loads all my flatpages and has the deisred effect on the homepage. But still the pages that

Re: How can I set a flatpage to be my homepage?

2010-11-24 Thread mongoose
I tried this approach urlpatterns += patterns('', (r'^$', 'django.views.generic.simple.direct_to_template', {'template': 'flatpages/homepage.html'}), ) Good news is it's loads the homepage. Bad news is that it loads a blank page. Other bad news is that now all the other flatpages don't

Re: list_filter doesn't appear for model with ForeignKey to auth.models.User

2010-11-24 Thread Carsten Fuchs
On 11/23/2010 08:37 PM, Carsten Fuchs wrote: none of the two list filters appears in the side bar (other filters that are similar but whose "target" model is not User work fine). Thus, my question is, is there something about model "User" that prevents it from being used with list_filter? What

Re: absolute url in template and url name

2010-11-24 Thread robos85
small correction not {{ url }} but {% url %} ? On 24 Lis, 14:01, robos85 wrote: > Hi, > I'm writing an email sending module based on on templates. I have no > idea how to put absolute url to my template (for > examplehttp://domain.com/account/activate/2). I have special url

Re: How do I get tracebacks printed to terminal?

2010-11-24 Thread David De La Harpe Golden
On 23/11/10 20:48, Markus Barth wrote: > I am using quite a lot of asynchronous calls for updating a page. The > problem is that this way you never see a traceback. In turbogears the > development server prints all tracebacks to the terminal. Is there any > way to get a similar behaviour with

absolute url in template and url name

2010-11-24 Thread robos85
Hi, I'm writing an email sending module based on on templates. I have no idea how to put absolute url to my template (for example http://domain.com/account/activate/2). I have special url for this, named account_activation. I know how to pass variables but how to create that url? Shouls I use {{

Re: How do I get tracebacks printed to terminal?

2010-11-24 Thread Reinout van Rees
On 11/23/2010 09:48 PM, Markus Barth wrote: I am using quite a lot of asynchronous calls for updating a page. The problem is that this way you never see a traceback. In turbogears the development server prints all tracebacks to the terminal. Is there any way to get a similar behaviour with

Re: [GD 2618] Problem with Mysql Queries in django

2010-11-24 Thread Jagdeep Singh
On Mon, Nov 22, 2010 at 11:40 PM, Jagdeep Singh Malhi wrote: Experiment make man perfect Problem solve using this simple query. client = ClientJob.objects.filter(date__year=2010).filter(date__month=11) Django is Wonderful, make a work very simple. -- Jagdeep Singh

Re: Problem with Mysql Queries in django

2010-11-24 Thread Jagdeep Singh Malhi
On Nov 22, 11:28 pm, Rogério Carrasqueira wrote: > Hi Jagdeep, > > Consider to use a query like this example: > > sales = > Sale.objects.extra(select={'month':'month(date_created)','year':'year(date_created)'}).values('year','month').annotate(month=11,year=2010)

Re: Thanks

2010-11-24 Thread Venkatraman S
On Wed, Nov 24, 2010 at 4:26 PM, kellpossible wrote: > django is awesome, the website is great, it has perhaps the most > helpful set of documentation I've ever used :) Thanks peoples. > > Praise all the good people associated with it :) -V- http://twitter.com/venkasub --

Thanks

2010-11-24 Thread kellpossible
django is awesome, the website is great, it has perhaps the most helpful set of documentation I've ever used :) Thanks peoples. -- 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.

How to set individual cache items so they don't timeout?

2010-11-24 Thread Ryan
I found this thread about how a timeout of 0 (= infinite) isn't passed to memcached properly: http://groups.google.com/group/django-developers/browse_thread/thread/a934ec625d35e942 The thread is from July, but the issue still exists in svn, and I couldn't find a ticket for this issue. How do I

Re: In-memory sorting of a QuerySet, yielding a QuerySet

2010-11-24 Thread bruno desthuilliers
On 24 nov, 02:18, Christophe Pettus wrote: > Of course, in struggling with this, I found myself thinking, "If only there > were a Field that > didn't use querysets, but took a list of tuples; then I could just use that > instead..."  :) Err... Would you mean, something like

Re: In-memory sorting of a QuerySet, yielding a QuerySet

2010-11-24 Thread bruno desthuilliers
On 24 nov, 02:06, Christophe Pettus wrote: > On Nov 23, 2010, at 2:25 AM, bruno desthuilliers wrote: > > > Strictly speaking, you don't need the queryset attribute of a > > ModelChoiceField to be a QuerySet instance - as long as the object you > > pass in has a '.all()' method

change of ORDER_PATTERN

2010-11-24 Thread Ralf
Hey, I want to use a coalesce-expression as orderBy-criteria in an admin- list-view. It seems to be easy with the following definition in the model: def end_extra(self, obj): return obj.endprj if obj.extraprj is None else obj.extraprj