Re: Django with Cherokee web server

2009-10-08 Thread Rudy Lattae
Folks, I think we should bring this back to the actual question and not derail the thread and ram it head first into the FUD vs FUD mountain. hcarvalhoalves original question was (and still remains): "I wanted to know if someone here on the list is using or used Cherokee with Django, if there's

about django.core.mail.send_mail

2009-10-08 Thread li kai
Can I send email using others' mail account following these steps? 1. I fill my own mail account and password in settings.py. 2. When using "send_mail(subject, message, sender, recipients)", I set sender to a different mail account. --~--~-~--~~~---~--~~ You

Re: Understanding "/admin/jsi18n/"

2009-10-08 Thread Anton Bessonov
http://www.google.com/search?q=django+jsi18n LuisC schrieb: > Hi!!! > I am doing my fist appl and after some struggling I am using > > forms.DateField(widget=AdminDateWidget) > > in my view, and > > > > > > {{ form.media }} > > in my template... > > The calendar widget is working ok; but I

Understanding "/admin/jsi18n/"

2009-10-08 Thread LuisC
Hi!!! I am doing my fist appl and after some struggling I am using forms.DateField(widget=AdminDateWidget) in my view, and {{ form.media }} in my template... The calendar widget is working ok; but I do not know what jsi18n does and I am unable to find it any where in the system. Also, I

Re: PID/processes for runserver

2009-10-08 Thread Karen Tracey
On Thu, Oct 8, 2009 at 6:47 PM, mviamari wrote: > > I've written a script to launch a server, run some tests and then kill > the server afterwards. The problem I'm having is that the PID > returned from the subprocess call is not the same as the PID needed to > kill the

PID/processes for runserver

2009-10-08 Thread mviamari
I've written a script to launch a server, run some tests and then kill the server afterwards. The problem I'm having is that the PID returned from the subprocess call is not the same as the PID needed to kill the server. Is there any way to get the runserver command to run with a single

Re: Django with Cherokee web server

2009-10-08 Thread Oli Warner
> > To stick with your analogy, it actually *is* like buying a car and being > surprised you don't get 0-60 in 5 seconds and 80 mpg, but only because > you will only drive it in second gear. And then you blame the dealer.. > Sure. Cherokee's an automatic ;p > >From the way you talk about

Checking download completed

2009-10-08 Thread Alvaro Mouriño
Hi list, I'm developing a website for a local newspaper which is distributed as PDF as well. I was asked to keep track of how many times each edition is downloaded, but I want to make a difference between completed downloads and uncompleted. Now I'm serving the file through the HttpResponse

Re: Admin why deleting related(null=True) objects?

2009-10-08 Thread Alex Robbins
This sounds related to this ticket http://code.djangoproject.com/ticket/9308, which supposedly fixed this issue 5 months ago. You should probably file a bug report. On Oct 7, 4:19 pm, Peter Sagerson wrote: > Yes, Django always cascades deletes. There's talk about providing

Re: Django with Cherokee web server

2009-10-08 Thread Tom Evans
On Thu, 2009-10-08 at 16:23 +0100, Oli Warner wrote: > FUD. You just think it is slow and inefficient because you > have never > configured it correctly. > > Analogy time. Gather round, children. > > You buy a car. The dealer said it can do 0 to 60mph in five seconds >

Automatic primary keys at model inheritance

2009-10-08 Thread Vlastimil Zíma
Hello, I am using django 1.1 and I discovered this problem: I have models like these --- class Place(model.Models) ... class Restaurant(Place) ... class Bar(Place) ... --- the primary key counters for Restaurant and Bar classes are

Re: import model from another project-app

2009-10-08 Thread Karen Tracey
On Thu, Oct 8, 2009 at 11:44 AM, Jorge Ercoli wrote: > > Ok Karen , cleaning my post: > > I have this two projects with 1 application each other: > > ProjectA with AppA (with your model) and ProjectB with AppB (with your > model). > > In the views.py of AppA , i should import

Re: Two cache-related questions

2009-10-08 Thread Christophe Pettus
On Oct 7, 2009, at 12:35 PM, kmike wrote: > 1. Maybe you can use django's Vary support ( > http://docs.djangoproject.com/en/dev/topics/cache/#using-vary-headers > ). Thank you! The method I came up with was to use the fragment-caching facility with the language code as one of the keys, which

Re: import model from another project-app

2009-10-08 Thread Jorge Ercoli
Ok Karen , cleaning my post: I have this two projects with 1 application each other: ProjectA with AppA (with your model) and ProjectB with AppB (with your model). In the views.py of AppA , i should import the model from AppB: from ProjectB.AppB.models import * (** without brackets,

Re: iphone to website

2009-10-08 Thread Christophe Pettus
> I'm looking at how to send information from the iphone to a django- > website. iPhone applications can generate web requests, so you can just generate an HTTP(S) request to your web site, and do whatever you want. -- -- Christophe Pettus x...@thebuild.com

Re: Django with Cherokee web server

2009-10-08 Thread Oli Warner
> > FUD. You just think it is slow and inefficient because you have never > configured it correctly. > Analogy time. Gather round, children. You buy a car. The dealer said it can do 0 to 60mph in five seconds and does 80 miles per gallon. You buy it for these reasons but when you receive it and

Re: ORM

2009-10-08 Thread Geobase Isoscale
Hi all, Thanks a lot, for the comments. I'm working with PostgreSQL database together with with Django and GeoDjango. I intended to use views to query externally joined tables that keep changing based on the updates. I was also looking at database consistency by taking into account constraints

Re: import model from another project-app

2009-10-08 Thread Karen Tracey
On Thu, Oct 8, 2009 at 10:52 AM, Jorge Ercoli wrote: > > If i have, my Proj1 with mi App1 and your Model, and in the Views.py i > should import a model from an App of another Project : > > > > What's with the brackets? Are you actually including the brackets in your .py file?

Re: problems subclassing models

2009-10-08 Thread Daniel Roseman
On Oct 8, 4:05 pm, Chris Withers wrote: > Hi All, > > I have a set of models that all have the same implementation for a > method, so I thought I'd create a base class for these: > > class UrlModel(models.Model): >      def get_absolute_url(self): >          return

Re: efficiently deleting content based on how old it is

2009-10-08 Thread Streamweaver
You could set this up as a custom manage.py command and run a cron on that. Gives the advantage of both initiating from outside the app and using Django's DB abstraction layer. A very simple way to do this would be to put all month text names in order in a tuple. i.e. monthnames = ('jan',

problems subclassing models

2009-10-08 Thread Chris Withers
Hi All, I have a set of models that all have the same implementation for a method, so I thought I'd create a base class for these: class UrlModel(models.Model): def get_absolute_url(self): return reverse(index,kwargs=dict(fk=self.pk)) ...and then have the relevant models

Is it possible to aggregate a field define in an extra method?

2009-10-08 Thread DavidA
I'm trying to understand how to use aggregation with "computed columns", that is, columns that are expressions defined in the extra() method, but it seems these aren't available in downstream parts of the query: class Trans(models.Model): parent = models.ForeignKey('self', null=True,

Re: efficiently deleting content based on how old it is

2009-10-08 Thread Chris Withers
Tim Chase wrote: > I wouldn't try to do it from within the web app itself -- > I'd schedule some wee-hours cron job to do the deletion. I plan to, don't worry ;-) But, I would like to do it from within the Django environment to make it immune to changes of database... > 6mo boundary. Your

import model from another project-app

2009-10-08 Thread Jorge Ercoli
If i have, my Proj1 with mi App1 and your Model, and in the Views.py i should import a model from an App of another Project : this command cause an error, i'm tried to put "Proj2.App1" in Proj1 settings.py Installed-Apps; but not work. Any ideas or examples?, thanks in advance.

Re: Overriding the default field types

2009-10-08 Thread Bogdan I. Bursuc
You want the field hidden or not on the form at all ? if you want it out of the form user exlude = ('dri',) on Meta but type exclude with a 'd' :) On Thu, 2009-10-08 at 07:14 -0700, luca72 wrote: > I have try it but the field dri is show in the form > > Luca > > On 8 Ott, 16:06, "Mark

SOLVED - Re: User object subclass appears in App models under Admin instead of Auth

2009-10-08 Thread Gerard
Hi all, The link below gave the answer. The difference was that I initially subclassed User .. I went with an extra table with 1-to-1 relation instead as the example stated Trick under admin is to subclass UserAdmin and re-register the User thingy. Works like a charm! Hope this helps, if

Re: Overriding the default field types

2009-10-08 Thread luca72
I have try it but the field dri is show in the form Luca On 8 Ott, 16:06, "Mark (Nosrednakram)" wrote: >  Hello Luca, > > > > > my models is this: > > class Per(models.Model): > >     dip = models.CharField(max_length=100) > >     di = models.CharField(max_length=100) >

Re: Overriding the default field types

2009-10-08 Thread Bogdan I. Bursuc
Yes is simple: just add the field to the form and will override the model one: class PerForm(ModelForm): dri = forms.CharField(max_length=100, widget=forms.HiddenInput()) class Meta: model = Per You should check the docs on the Widgets to make sure:

Re: Overriding the default field types

2009-10-08 Thread Mark (Nosrednakram)
Hello Luca, > my models is this: > class Per(models.Model): >     dip = models.CharField(max_length=100) >     di = models.CharField(max_length=100) >     df = models.CharField(max_length=100) >     m = models.CharField(max_length=500) >     dri = models.CharField(max_length=100) > > the form

Overriding the default field types

2009-10-08 Thread luca72
hello my models is this: class Per(models.Model): dip = models.CharField(max_length=100) di = models.CharField(max_length=100) df = models.CharField(max_length=100) m = models.CharField(max_length=500) dri = models.CharField(max_length=100) the form is this: class

Re: ORM

2009-10-08 Thread Mark (Nosrednakram)
Hello Isoscale, >  I intend to write ORM code that will create views and triggers in the > database? Which parts of the source code should I alter? I use django to access views commonly, primarily for reporting I'll create views taking care of the complex joins from our ERP so developers can

Re: efficiently deleting content based on how old it is

2009-10-08 Thread Tim Chase
> I only want to keep 6 months worth of data. How can I > efficiently delete a month and all it's associated > services and those services associated pages? (in this > app, there could be about 3 million pages that are > associated with each month though a bunch of service > objects) I

Re: iphone to website

2009-10-08 Thread grant neale
Well 1 problem I was thinking about was uploading photos. Any suggestion. Grant On Oct 8, 2009, at 2:39 PM, Chris Withers wrote: > > grant neale wrote: >> Does anyone have a hint on where I should start, re: making the >> website ready to receive this information? > > Doesn't the iPhone have a

Re: Is django comment's honeypot really useful?

2009-10-08 Thread Eric Abrahamsen
On Oct 8, 2009, at 8:20 PM, Joshua Partogi wrote: > >> even the developers who know what is happening shouldn't complain. >> >> I have a site that seems to get crawled by bots quite frequently. I >> had a >> feedback form that didn't have a honeypot originally. I got about >> 3-4 pieces >>

Re: User object subclass appears in App models under Admin instead of Auth

2009-10-08 Thread Gerard
Found a solution that's getting me closer to my goal http://www.thenestedfloat.com/articles/displaying-custom-user-profile-fields-in-djangos-admin Regards, Gerard. Gerard wrote: > Hi all, > > I've subclassed Django's User object (also accessible under Admin) to extend > the user profile.

Problems with custom Auth Backends: 'NoneType' object has no attribute 'DoesNotExist'

2009-10-08 Thread Sandra Django
Hi, I want add a new attribute in User model and create custom backends. Steep by steep, I did the following: 1) I created an application named "profile" into my project 2) I created, in models.py of "profile" a class named "UserProfile", which inherits from User class of Django. I added

Re: iphone to website

2009-10-08 Thread Chris Withers
grant neale wrote: > Does anyone have a hint on where I should start, re: making the > website ready to receive this information? Doesn't the iPhone have a web browser? Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk

Re: ORM Cache in a standalone script

2009-10-08 Thread Alexis MINEAUD
Thanks a lot Karen, transaction was the problem. Resolved by : connection.cursor().execute('set transaction isolation level read committed') Have a nice day :) On Thu, Oct 8, 2009 at 1:52 PM, Karen Tracey wrote: > On Thu, Oct 8, 2009 at 5:07 AM, Alexis MINEAUD

Re: Is django comment's honeypot really useful?

2009-10-08 Thread Joshua Partogi
> even the developers who know what is happening shouldn't complain. > > I have a site that seems to get crawled by bots quite frequently. I had a > feedback form that didn't have a honeypot originally. I got about 3-4 pieces > of spam a day. Turning on the honey pot, I only have gotten a few

Re: ModelForm

2009-10-08 Thread luca72
Thanks On 8 Ott, 12:54, Tom Evans wrote: > On Thu, 2009-10-08 at 13:27 +0300, Bogdan I. Bursuc wrote: > > I'm sorry, but i still can't figure out where the error comes. > > Can you post your traceback from the error page ? > > The error comes because he misspelled

Re: Is django comment's honeypot really useful?

2009-10-08 Thread Michael
On Thu, Oct 8, 2009 at 12:12 AM, Kenneth Gonsalves wrote: > > On Thursday 08 Oct 2009 9:32:23 am Joshua Partogi wrote: > > I want to ask for your advice here regarding the honeypot field in > > django comments. Is it really useful to prevent spam? Or should we add > >

User object subclass appears in App models under Admin instead of Auth

2009-10-08 Thread Gerard
Hi all, I've subclassed Django's User object (also accessible under Admin) to extend the user profile. But the 'CustomUser' model ends up in the Myapp list instead of under Auth. I need it 'top level' otherwise I and up with users for every seperate module/app in my project. Would this be

Re: ORM Cache in a standalone script

2009-10-08 Thread Karen Tracey
On Thu, Oct 8, 2009 at 5:07 AM, Alexis MINEAUD wrote: > Ok, my bad, the sequence works well, i just confused the field name... > But the problem is still there if the update is done by another actor than > Django itself. > > My standalone script is daemon which poll my DB

Re: Models for a hockey database

2009-10-08 Thread Christian Wittwer
Hi, > I have a pretty large site that tracks a football team and it's league > ( http://www.muskegohitmen.com ). That sounds interesting.. ;-) > Things you'll probably want to consider > Seasons - a very small model class, but organizing things by a season > becomes pretty tricky with out

Re: Models for a hockey database

2009-10-08 Thread Christian Wittwer
Hi, > class Team(models.Model): >    name = models.CharField(max_length=60) > > class Player(models.Model): >    surname = models.CharField(max_length=60) >    lastname = models.CharField(max_length=60) >    team = models.ForeignKey(Team) > > Now you can just specify the home_team and the

Re: ModelForm

2009-10-08 Thread Tom Evans
On Thu, 2009-10-08 at 13:27 +0300, Bogdan I. Bursuc wrote: > I'm sorry, but i still can't figure out where the error comes. > Can you post your traceback from the error page ? > The error comes because he misspelled 'class Meta' as 'class meta'. >>> class profilemodelform(ModelForm): ...

Re: ORM

2009-10-08 Thread Matt Schinckel
On Oct 8, 6:18 pm, Marek Pietrucha wrote: > I see that all of you guy's know what your talking about. I was > thinking way won't you share some knowledge to this > topic:http://groups.google.com/group/django-users/browse_thread/thread/1517... > What does this have to

Re: QuerySets with annonate, count() and multiple fields

2009-10-08 Thread Emily Rodgers
On Oct 8, 8:36 am, Emily Rodgers wrote: > On 8 Oct, 01:31, Russell Keith-Magee wrote: > > > > > On Thu, Oct 8, 2009 at 1:43 AM, Emily Rodgers > > > wrote: > > > > Hello, > > > > I am a bit stuck on

Re: Models for a hockey database

2009-10-08 Thread esatterwh...@wi.rr.com
I have a pretty large site that tracks a football team and it's league ( http://www.muskegohitmen.com ). What I did was to have an abstract base statistics class that is attached to a player/user. then mad a class for every stat i wanted to track class Statistics(models.Model): #base class

Re: ModelForm

2009-10-08 Thread Bogdan I. Bursuc
I'm sorry, but i still can't figure out where the error comes. Can you post your traceback from the error page ? On Thu, 2009-10-08 at 02:24 -0700, luca72 wrote: > Hello and thanks for your help > This is the form > > > www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> >

new permission

2009-10-08 Thread elminio
Hi, I've extended my model with new permission. class Meta: permissions = ( ("total", "total"), ) After that I mafe manage.py syncdb. But after that when I wanted to add user new privilage just created there wasn't it in admin panel where you can choose permissions

efficiently deleting content based on how old it is

2009-10-08 Thread Chris Withers
Hi All, I have a set of models structured roughly as follows: class Month(models.Model): monthname = models.CharField( max_length=14, db_index=True, verbose_name='Month' ) ... class Service(models.Model): month = models.ForeignKey(Month)

Re: ModelForm

2009-10-08 Thread luca72
Hello and thanks for your help This is the form http://www.w3.org/1999/xhtml; xml:lang="en" lang="en"> {{titolo}} {{form.as_table}} Luca On 8 Ott, 10:33, "Bogdan I. Bursuc" wrote: > so the error comes up at the first access

Re: ModelForm

2009-10-08 Thread Tom Evans
On Thu, 2009-10-08 at 00:04 -0700, luca72 wrote: > Hello this is my model: > from django.db import models > > > class Per(models.Model): > dip = models.CharField(max_length=100) > data_ini = models.CharField(max_length=100) > data_fin = models.CharField(max_length=100) > mot =

Re: ORM Cache in a standalone script

2009-10-08 Thread Alexis MINEAUD
Ok, my bad, the sequence works well, i just confused the field name... But the problem is still there if the update is done by another actor than Django itself. My standalone script is daemon which poll my DB with a XX.objects.all(). If i updated myself a row from XX, the daemon doesn't see the

bulk import limits?

2009-10-08 Thread Chris Withers
Hi All, I need to import data from a legacy app (non-relational database). I was planning to do an xml dump from the old app (which is now done and working) but turns out that the app has rather more data in it than I realised ;-) I need to import about 40 million rows into one table. I take

iphone to website

2009-10-08 Thread grant neale
Hi, I'm looking at how to send information from the iphone to a django- website. Via email or via an app(like the one that wordpress uses) or by an app that I will build. Does anyone have a hint on where I should start, re: making the website ready to receive this information? Thanks

Re: Django with Cherokee web server

2009-10-08 Thread Tom Evans
On Wed, 2009-10-07 at 23:54 +0100, Oli Warner wrote: > People quite happily run Django on memory starved VPS systems > using > Apache/mod_wsgi with optional nginx front end for static > files. > > Apache is woefully slow and inefficient at static serving. A static

Re: ModelForm

2009-10-08 Thread Bogdan I. Bursuc
so the error comes up at the first access could you please post the template where you render the form, i think the error is there, you try to access something that isn't set yet. On Thu, 2009-10-08 at 01:28 -0700, luca72 wrote: > Hello this is the views file > > from django.http import

Re: ModelForm

2009-10-08 Thread luca72
Hello this is the views file from django.http import HttpResponse from django.shortcuts import render_to_response from models import * from forms import PermessiForm def mostro_permesso(request): titolo = 'Richiesta Permessi' if request.method == 'POST': form =

Re: ORM

2009-10-08 Thread Marek Pietrucha
I see that all of you guy's know what your talking about. I was thinking way won't you share some knowledge to this topic: http://groups.google.com/group/django-users/browse_thread/thread/1517053b51a1d7c8/ Please read and give some response. best regards. On Oct 7, 7:05 pm, Christophe Pettus

Re: QuerySets with annonate, count() and multiple fields

2009-10-08 Thread Emily Rodgers
On 8 Oct, 01:31, Russell Keith-Magee wrote: > On Thu, Oct 8, 2009 at 1:43 AM, Emily Rodgers > > > > wrote: > > > Hello, > > > I am a bit stuck on something that I think ought to be really easy (so > > I am probably being really

Re: ModelForm

2009-10-08 Thread Bogdan I. Bursuc
I think we need a little more info here, post your urls.py that contain mostro_permesso url and your view that is linked to that url. On Thu, 2009-10-08 at 00:04 -0700, luca72 wrote: > Hello this is my model: > from django.db import models > > > class Per(models.Model): > dip =

ModelForm

2009-10-08 Thread luca72
Hello this is my model: from django.db import models class Per(models.Model): dip = models.CharField(max_length=100) data_ini = models.CharField(max_length=100) data_fin = models.CharField(max_length=100) mot = models.CharField(max_length=500) data_rich=