Re: signals documentation question

2012-10-29 Thread Russell Keith-Magee
On Tue, Oct 30, 2012 at 1:40 PM, Mike Dewhirst wrote: > The 1.5 docs say ... > > Where should this code live? > You can put signal handling and registration code anywhere you like. > However, you'll need to make sure that the module it's in gets imported > early on so that

signals documentation question

2012-10-29 Thread Mike Dewhirst
The 1.5 docs say ... Where should this code live? You can put signal handling and registration code anywhere you like. However, you'll need to make sure that the module it's in gets imported early on so that the signal handling gets registered before any signals need to be sent. This makes

Template Inheriting in Apache server

2012-10-29 Thread Pervez Mulla
Hi, Sorry for this question in this group .I Just wanted to know is there any way , I can Inherit different HTML templates from base.html as we do in Django framework in Apache2 server? Thank You Pervez -- You received this message because you are subscribed to the Google Groups "Django

a problem about django-grappelli

2012-10-29 Thread Scarl
After I use django-grappelli, the admin site looks very nice. But when I enter /admin/diary/day, and add something, it looks terrible. It shows left side only! I want it to

Re: Joining querysets?

2012-10-29 Thread Lachlan Musicman
On Tue, Oct 30, 2012 at 1:35 PM, Lachlan Musicman wrote: > Hola, > > So I've reached the point where I feel it necessary to join querysets. Don't bother with this - I just wrote a better Query to solve this issue L. > > All the ref's I've read online are quite old and

Joining querysets?

2012-10-29 Thread Lachlan Musicman
Hola, So I've reached the point where I feel it necessary to join querysets. All the ref's I've read online are quite old and recommend using | or itertools.chain() Are these still the recommended method, or am I doing it wrong? cheers L. -- ...we look at the present day through a rear-view

Re: Reverse and kwargs...

2012-10-29 Thread Christophe Pettus
On Oct 29, 2012, at 5:06 PM, Lachlan Musicman wrote: > Your solution made it work, and I'm a doofus. Let he who is without having spent the entire day looking for a punctuation error in code cast the first stone. :) -- -- Christophe Pettus x...@thebuild.com -- You received this message

Re: Reverse and kwargs...

2012-10-29 Thread Lachlan Musicman
On Tue, Oct 30, 2012 at 1:03 PM, Christophe Pettus wrote: > > On Oct 29, 2012, at 4:52 PM, Lachlan Musicman wrote: >> Could you please expand on your answer for a beginner? GAH! Thanks. I've been thinking that there's got to be an easier way to get and generate these reports,

Easy way to make all form fields read only?

2012-10-29 Thread Matthew Woodward
Semi-new to Django and working on my first "real" app, and I have a need based on the user's credentials to display forms as either editable or read-only. (Note this doesn't have anything to do with the Django admin in case that has any bearing on the discussion.) Is there some fancy whiz-bang

Re: Reverse and kwargs...

2012-10-29 Thread Christophe Pettus
On Oct 29, 2012, at 4:52 PM, Lachlan Musicman wrote: > Could you please expand on your answer for a beginner? student-reports in the reverse call vs student_reports in the url() definition? -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribed to

Re: Reverse and kwargs...

2012-10-29 Thread Lachlan Musicman
On Tue, Oct 30, 2012 at 12:44 PM, Christophe Pettus wrote: > - vs _ ? > I'm sorry, I'm not experienced enough or sufficiently knowledgeable about python or django to understand your response. I understand that _ has some relevance as an indicator of global vars and functions

Re: Reverse and kwargs...

2012-10-29 Thread Christophe Pettus
- vs _ ? On Oct 29, 2012, at 4:38 PM, Lachlan Musicman wrote: > On Tue, Oct 30, 2012 at 11:14 AM, Nikolas Stevenson-Molnar > wrote: >> You're close. Your reverse calls should be: >> >> return redirect(reverse('student-reports', kwargs={'year': year})) > > Thanks - that

Re: Reverse and kwargs...

2012-10-29 Thread Lachlan Musicman
On Tue, Oct 30, 2012 at 11:14 AM, Nikolas Stevenson-Molnar wrote: > You're close. Your reverse calls should be: > > return redirect(reverse('student-reports', kwargs={'year': year})) Thanks - that makes sense. I might have even done that previously, but I am still getting

Re: Reverse and kwargs...

2012-10-29 Thread André Dieb
On Mon, Oct 29, 2012 at 8:11 PM, Lachlan Musicman wrote: > Hi, > > I'm struggling to get the syntax right for a url reverse function. > > I have a form that asks for a Model type (ChoiceField with strings) > and a year (CharField). > > The logic then if/elifs the ChoiceField

Re: Reverse and kwargs...

2012-10-29 Thread Nikolas Stevenson-Molnar
You're close. Your reverse calls should be: return redirect(reverse('student-reports', kwargs={'year': year})) _Nik On 10/29/2012 4:11 PM, Lachlan Musicman wrote: > Hi, > > I'm struggling to get the syntax right for a url reverse function. > > I have a form that asks for a Model type

Reverse and kwargs...

2012-10-29 Thread Lachlan Musicman
Hi, I'm struggling to get the syntax right for a url reverse function. I have a form that asks for a Model type (ChoiceField with strings) and a year (CharField). The logic then if/elifs the ChoiceField and then redirects to the appropriate report page (for statistics on the Model type), with

Re: django + tinymce problems

2012-10-29 Thread sri
Thanks for the reply Tom. It worked after changing to relative paths. Sreekanth On Monday, 29 October 2012 11:13:17 UTC, Tom Evans wrote: > > On Sun, Oct 28, 2012 at 9:44 PM, sri > wrote: > > Hi, > > > > I have tried using tinymce in my sample django application, but

managing relative urls for django ssi command

2012-10-29 Thread tap hatte
I have a static directory which contains bunch of html files and images. All html files contain links to each other using relative paths. For instance, a page describing an algorithm has a link such as Algorithm 2 Everything in this directory works very well in a portable manner in any static

Re: How to implement clean() for a model with ManyToMany fields?

2012-10-29 Thread Martin J. Laubach
Basically, you can't. M2m fields are saved after the model is saved, so you either get objects that are not yet ready for that check (as you experienced) or you will test the previous value of the m2m field, neither of which is what you want. You can modify the admin interface and do the

Re: Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-29 Thread Kurtis Mullins
The old rule of thumb is to avoid premature optimization. I'd build, profile, then scale or otherwise optimize as needed. This isn't a tutorial or really a discussion on all points of scaling a system; but identifying bottle necks will do wonders when it comes to deciding what, where, and how to

Re: Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-29 Thread Cal Leeming [Simplicity Media Ltd]
Hi Isaac, If there is one thing I have learnt about scaling apps, it's about trying things out for yourself. Sure there are some best practice guidelines (i.e. serving files from nginx, or using apache's X-SendFile rather than streaming out via the webapp), but if someone comes along and tells

Custom Admin Panel

2012-10-29 Thread Some Developer
Hi, I'm in the process of writing a Django site and one of the requirements is that it have a custom admin panel and a custom control panel but I am having some problems coming up with the best way to organise my application. My initial idea was to have the admin (and control) panels as

Re: Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-29 Thread Some Developer
On 29/10/2012 16:03, Isaac XXX wrote: Hi there, thank you for response Tom. Actually, I've a complete idea at how to build this system, but I lack the exact information about how to join systems, and what I was looking for was a source of cohesive information on all systems. At least, when

Re: Database setup

2012-10-29 Thread Tom Evans
On Mon, Oct 29, 2012 at 3:54 PM, Onyx Fields wrote: > I wish I could help as well, but I just started with the tutorial (HERE), > and I am not following the Database Setup either. Perhaps someone who is > more familiar with it could explain it in layman's terms for

Re: Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-29 Thread Tom Evans
On Mon, Oct 29, 2012 at 4:03 PM, Isaac XXX wrote: > Hi there, > > thank you for response Tom. > > Actually, I've a complete idea at how to build this system, but I lack the > exact information about how to join systems, and what I was looking for was > a source of cohesive

Re: Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-29 Thread Isaac XXX
Hi there, thank you for response Tom. Actually, I've a complete idea at how to build this system, but I lack the exact information about how to join systems, and what I was looking for was a source of cohesive information on all systems. At least, when I finish to build that system, I will

Re: Database setup

2012-10-29 Thread Onyx Fields
I wish I could help as well, but I just started with the tutorial (HERE), and I am not following the Database Setup either. Perhaps someone who is more familiar with it could explain it in layman's terms for a noob like myself? On

Re: Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-29 Thread Tom Evans
On Mon, Oct 29, 2012 at 2:42 PM, Isaac XXX wrote: > Hi folks, > > I'm developing a new application that should get high traffic. Right now, > I've other projects with the follow architecture: > > Nginx on front: serving static content and redirecting to apache for dynamic >

Re: 1.5: syntax of AUTH_USER_MODEL

2012-10-29 Thread Tomas Neme
> Thanks, yup! I just figured it out too. I didn't realize all the "apps" are > in the path as well. the apps aren't NECESSARILY in the path. Django has a concept of app label, which is the name of the directory where the models module exists. For example, django-cms has plugins, which in order

How to implement clean() for a model with ManyToMany fields?

2012-10-29 Thread Carsten Fuchs
Hi all, using Django 1.3.1, I use a model like this: class KalenderEintrag(models.Model): id = models.AutoField(primary_key=True) von = models.DateField(verbose_name=u"\u200Bvon") bis = models.DateField(verbose_name=u"\u200Bbis") text =

Re: 1.5: syntax of AUTH_USER_MODEL

2012-10-29 Thread Anil
Thanks, yup! I just figured it out too. I didn't realize all the "apps" are in the path as well. Anil On Monday, October 29, 2012 7:52:45 AM UTC-7, Tom Christie wrote: > > You don't mention 'app1.MyUser', which is what I think it should be. > > On Monday, 29 October 2012 14:50:15 UTC, Anil

Re: 1.5: syntax of AUTH_USER_MODEL

2012-10-29 Thread Tom Christie
You don't mention 'app1.MyUser', which is what I think it should be. On Monday, 29 October 2012 14:50:15 UTC, Anil wrote: > > I have the following filesystem structure: > > project > project/app1 > project/app1/models.py <--- class MyUser(AbstractBaseUser) > project/project >

1.5: syntax of AUTH_USER_MODEL

2012-10-29 Thread Anil
I have the following filesystem structure: project project/app1 project/app1/models.py <--- class MyUser(AbstractBaseUser) project/project project/project/settings.py project/project/urls.py ... I set my AUTH_USER_MODEL to 'project.app1.models.MyUser', I get error: auth.user: AUTH_USER_MODEL is

Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-29 Thread Isaac XXX
Hi folks, I'm developing a new application that should get high traffic. Right now, I've other projects with the follow architecture: Nginx on front: serving static content and redirecting to apache for dynamic data Apache+mod_wsgi: serving dynamic pages PostgreSQL: backend for data storage

Re: Changing the index page

2012-10-29 Thread Rodrigo Morgado
Helllo Sorin, Thank you for the fix, really works to me too. I don't know why django broke admin view without changes by me. May i ask you one thing?. What really do static and get_static_prefix?. Thank you 2012/10/28 Sorin Popa > Hello,.. obviously my answer comes late,

Re: display additional information, best practice

2012-10-29 Thread Stefano Tranquillini
i gave it a look. but seems that detail view let me to display a model by just writing the template and not the view. right? the point is, i've information that are not already in the object i want to display. example: i want to display the model called "Question" which has a set of "answers"

Re: django + tinymce problems

2012-10-29 Thread Tom Evans
On Sun, Oct 28, 2012 at 9:44 PM, sri wrote: > Hi, > > I have tried using tinymce in my sample django application, but i am not > getting the tinymce editor in my admin pages. > > I am trying to setup tinymce to use in admin pages and using Django 1.4 > > This is how my

Re: Connecting to external databases from Views.py

2012-10-29 Thread Gregg Branquinho
Thanks Tom for this info I have adjusted the models .py as such.. from django.db import models class ModelManagerReadOnly(model.Manager): def update(self, *args, **kwargs): pass class ModelReadOnly(models.Model): objects = ModelManagerReadOnly() # The ReadOnly manager.

Re: Connecting to external databases from Views.py

2012-10-29 Thread Tom Evans
On Mon, Oct 29, 2012 at 8:44 AM, Gregg Branquinho wrote: > from django.db import models > > > class ModelManagerReadOnly(model.Manager): > def update(self, *args, **kwargs): > pass > > > class ModelReadOnly(models.Model): > objects = ModelManagerReadOnly() #

Re: Database setup

2012-10-29 Thread Markus Christen
EDIT: I have a second to implements. Its a Lotus Notes DB, and for the userauth there is a file on my computer. I tryed it with the odbc of IBM: --- import pyodbc conn = pyodbc.connect('DRIVER={Lotus Notes SQL Driver

Re: Connecting to external databases from Views.py

2012-10-29 Thread Gregg Branquinho
from django.db import models class ModelManagerReadOnly(model.Manager): def update(self, *args, **kwargs): pass class ModelReadOnly(models.Model): objects = ModelManagerReadOnly() # The ReadOnly manager. def save(self, *args, **kwargs): pass

Database setup

2012-10-29 Thread Markus Christen
Good Morning First i made an odbc connect liek this: - import pyodbc cnxn = pyodbc.connect('DRIVER={SQL Server};SERVER=MAURITIUS;DATABASE=baan5c;UID=***;PWD=*') cursor = cnxn.cursor() cursor.execute("SELECT x.t_name, y.t_mail FROM

Re: Connecting to external databases from Views.py

2012-10-29 Thread Gregg Branquinho
Hi guys thanks for the help so Far, from what I understand this is what I have to do for models.. from django.db import models class ModelReadOnly(models.Model): def save(self, *args, **kwargs): pass #raise NotImplemented class Meta: managed = False