Re: Django Set HTTP Error manually

2007-04-09 Thread Ivan Sagalaev
johnny wrote: > What I want to do is set HTTP Error manually in my view, when a > request is made to certain url, without post data. > > At a particular url, my view is looking for XML document to be sent > over http, by post. If a request come in without post, I want to > raise an error "405 Me

Re: unique_together Validator for a model with an (editable=False) field

2007-04-09 Thread Mark Soper
I created custom AddManipulator and ChangeManipulator classes in my model to do model-level validation. This did require a minor change to django/db/models/manipulators.py. The details of this change and the definition of the model are appended here. I have not done extensive testing yet, but t

Updating Django .95 -> .96 on Mac

2007-04-09 Thread brian mckinney
I am attempting to upgrade from .95 to .96 using the setup script both times and was not able to get my mac to look at the new version, since the old path is through 'Django-0.95-py2.4.egg', and the new path is simply located under 'django'. Could someone shed a bit of light on this? --~--~

Re: generic views 'extra_context' value via function call utility

2007-04-09 Thread Russell Keith-Magee
On 4/10/07, Martin J Hsu <[EMAIL PROTECTED]> wrote: > > I saw this as a minor inconsistency in how settings are defaulted. > Not a big deal to me personally. Django was made by perfectionists > and I thought I'd point this out. Django-admin produces a default settings file that contains the most

Re: generic views 'extra_context' value via function call utility

2007-04-09 Thread Martin J Hsu
On Apr 10, 10:14 am, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On 4/9/07, Martin J Hsu <[EMAIL PROTECTED]> wrote: > > > > > The a value (a callable) in the 'extra_context' dict passed to a > > generic view (like django.views.generic.list_detail.object_list) can > > be used to computed t

Re: Django Set HTTP Error manually

2007-04-09 Thread James Bennett
On 4/9/07, johnny <[EMAIL PROTECTED]> wrote: > At a particular url, my view is looking for XML document to be sent > over http, by post. If a request come in without post, I want to > raise an error "405 Method Not Allowed". How do I do this? response = HttpResponse('some output here') response

Django Set HTTP Error manually

2007-04-09 Thread johnny
What I want to do is set HTTP Error manually in my view, when a request is made to certain url, without post data. At a particular url, my view is looking for XML document to be sent over http, by post. If a request come in without post, I want to raise an error "405 Method Not Allowed". How do

Re: Django scaling and Database replication

2007-04-09 Thread James Bennett
On 4/9/07, Merric Mercer <[EMAIL PROTECTED]> wrote: > The issue with Cluster is that it is designed to work synchronously. > This is fine when the all the DB is on a fast, local network but not > when the DB needs to be replicated to geographically different networks, > where latency becomes a maj

Re: generic views 'extra_context' value via function call utility

2007-04-09 Thread Russell Keith-Magee
On 4/9/07, Martin J Hsu <[EMAIL PROTECTED]> wrote: > > The a value (a callable) in the 'extra_context' dict passed to a > generic view (like django.views.generic.list_detail.object_list) can > be used to computed the value of a tag: > http://www.djangoproject.com/documentation/generic_views/#djang

Re: Django scaling and Database replication

2007-04-09 Thread Merric Mercer
James, The issue with Cluster is that it is designed to work synchronously. This is fine when the all the DB is on a fast, local network but not when the DB needs to be replicated to geographically different networks, where latency becomes a major issue. Django already cares and knows about

simplifying a dynamic template lookup

2007-04-09 Thread Carlos Hanson
I have some items with totals for each school in a school district. Each item also has a grand total. The TotalClass has a name, total and dictionary of schools with their individual totals. Based on another post I finally figured out how to get the school total for which I'm looking when lookin

Re: Django scaling and Database replication

2007-04-09 Thread Julio Nobrega
Hummm... looks like I own you an apology, Merric. I was wrong about how to access the replicated data on the slave hosts. I was either thinking about clusters or I was flat out wrong. But what James said, and kemuri, approachs my mistake. I hope it helps you :) On 4/9/07, Merric Mercer <[EMA

Re: Django scaling and Database replication

2007-04-09 Thread James Bennett
On 4/9/07, Merric Mercer <[EMAIL PROTECTED]> wrote: > The official documentation on MySQL 5.1 "Using Replication for > ScaleOut" is explicit and states that it is the application (Django) > that needs to send the writes to the Master and the Reads to the > Slaves.Unless I'm wrong this would r

Re: Django models to SqlAlchemy models | preliminary implementation

2007-04-09 Thread limodou
On 4/10/07, Norjee <[EMAIL PROTECTED]> wrote: > > Quite often there has been talk about using SqlALchemy in Django, but > as far as I'm aware there is no implementation yet. > > For me, replacing Django's model is definitely too ambitious, so I > tried the next best thing, use Django's model decla

Re: delimiter problem with initial sql

2007-04-09 Thread hgarcia
On Mar 17, 5:22 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > ... > Sorry, not much encouragement for you there, but if you have any bright, > truly database-portable ideas, we'd love to hear them. > I've the same problem and run a separate scripts is annoying, maybe a solution should be

Find Programming Job?

2007-04-09 Thread Cindy
Find Your Programming Job Vacancy and resources here --> http://www.jobbankdata.com/job-programming.htm --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djan

Re: Question regarding the new url() function

2007-04-09 Thread Malcolm Tredinnick
On Mon, 2007-04-09 at 13:53 -0700, Florian Apolloner wrote: > Ah now I see ;) url() is to be used if I don't need extra_directory, > any other differences? It's purely a convenience function. Under the covers, the tuple version is converted to a call to url() in any case. The advantage of introd

Re: Django scaling and Database replication

2007-04-09 Thread Merric Mercer
The official documentation on MySQL 5.1 "Using Replication for ScaleOut" is explicit and states that it is the application (Django) that needs to send the writes to the Master and the Reads to the Slaves.Unless I'm wrong this would rule out using replication with Django. The quote from

Re: Django scaling and Database replication

2007-04-09 Thread Merric Mercer
Julio, In this scenario am I right in thinking that in MySQL the Master automatically acts as a load balancer and that I therefore don't need any other software to automatically delegate reads between slaves and MySQL knows to send all writes to the Master? I'm slightly confused, I've been

Re: error in subclassing models.Model

2007-04-09 Thread checco
Thanks a lot James, I've just tried the same modifying an existing file of the cheeserater source code: to be precise I added the following lines: class Person(models.Model): pass at the end of the file models.py under c:\cheeserater\packages but I still get the same error Maybe I misunder

Re: error in subclassing models.Model

2007-04-09 Thread James Bennett
On 4/9/07, checco <[EMAIL PROTECTED]> wrote: > Then, these really basic statements give me this error: > > >>> from django.db import models > >>> class Person(models.Model): > pass This is somewhat counterintuitive unless you know a bit about how Django's model system works; 'app_label' i

Re: Question regarding the new url() function

2007-04-09 Thread Florian Apolloner
Ah now I see ;) url() is to be used if I don't need extra_directory, any other differences? On 9 Apr., 22:51, "Florian Apolloner" <[EMAIL PROTECTED]> wrote: > When does I have to use url() as described > here:http://www.djangoproject.com/documentation/url_dispatch/#naming-url-p... > > Cause acco

Question regarding the new url() function

2007-04-09 Thread Florian Apolloner
When does I have to use url() as described here: http://www.djangoproject.com/documentation/url_dispatch/#naming-url-patterns Cause according to here: http://www.djangoproject.com/documentation/url_dispatch/#patterns I already can pass the optional name. So what should I use? Btw: Maybe I am to

Re: about newforms

2007-04-09 Thread anders conbere
My experience has been that if you are able to use the newforms convenience functions (form_for_model and form_for_instance) there is a sizable amount of information on the net on how to effectively implement them. However there seems to be almost no body of knowledge regarding effective use of cu

Re: Index in admin

2007-04-09 Thread Brian Rosner
On 2007-04-09 04:57:14 -0600, "Martin" <[EMAIL PROTECTED]> said: > > order_with_respect_to might be the solution, but it does not seem to > work. > > /Martin > > > Yeah this is outlined in http://code.djangoproject.com/ticket/13. It appears that newforms-admin is on its way to help resolve

Django models to SqlAlchemy models | preliminary implementation

2007-04-09 Thread Norjee
Quite often there has been talk about using SqlALchemy in Django, but as far as I'm aware there is no implementation yet. For me, replacing Django's model is definitely too ambitious, so I tried the next best thing, use Django's model declaration to create a SqlAlchemy binding. For most of the (r

error in subclassing models.Model

2007-04-09 Thread checco
I update the django distribution quite regularly and recently I get an unexpected error. Let's suppose I'm using the settings.py file from the cheeserater code (the django website recently launched with source code available). At the IDLE startup I write the following: >>> import os, sys >>> os.

Re: Integrating Jasper reports / Reporting in general ??

2007-04-09 Thread Joel
Ahh - forget it. I looked further into ReportLab and found out just how impressive it is. -- Joel Joel wrote: > I saw that someone has let Ruby use JasperReports with a simple script: > > http://wiki.rubyonrails.org/rails/pages/HowtoIntegrateJasperReports > > I would love to use Jasper Report

Re: newb: Sending Request to Django Dev Server, From Python Terminal

2007-04-09 Thread [EMAIL PROTECTED]
urllib2.urlopen should give you what you need if I understand your question. On Apr 9, 11:42 am, "johnny" <[EMAIL PROTECTED]> wrote: > > why don't you just use a browser? > > I need to construct and load xml data from python shell and send it to > the dev server. I don't think you can do this in

Re: Django scaling and Database replication

2007-04-09 Thread Merric Mercer
Thank Kemuri, MySQL cluster seems very cool, but I'm not sure it is the best solution if the DB is split over different networks . Latency might be an issue with the synchronous setup that MySQL cluster provides. Having looked at it a bit further since my post I am considering "circular repli

Integrating Jasper reports / Reporting in general ??

2007-04-09 Thread Joel
I saw that someone has let Ruby use JasperReports with a simple script: http://wiki.rubyonrails.org/rails/pages/HowtoIntegrateJasperReports I would love to use Jasper Reports because we use it on other (Java and PHP) projects and it has a great, free report editor (http://jasperforge.org/sf/wiki

Re: newb: Sending Request to Django Dev Server, From Python Terminal

2007-04-09 Thread johnny
> why don't you just use a browser? I need to construct and load xml data from python shell and send it to the dev server. I don't think you can do this in the browser. Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Django scaling and Database replication

2007-04-09 Thread kemuri
hey Merric, On Apr 9, 4:10 am, Merric Mercer <[EMAIL PROTECTED]> wrote: > The django book's chapter on deployment mentions the use of Database > replication as a means to scale using MySQL. > If you want to try something cool, try MySQL Cluster, and better 5.1 since it has disk-based support in

Ticket-worthy? 0.96 newforms custom widget TypeError exception suppressed by render_to_response

2007-04-09 Thread JeffH
Is this worthy of a ticket? Observed behavior: Django (v0.96) render_to_response renders a template but renders nothing for {{ form.as_table }} tag when (unbeknownst to the poor programmer) a TypeError exception is raised during the rendering of a custom newforms widget. My preferred behavior: g

Re: about newforms

2007-04-09 Thread Craig Kuhns
I found this example to help me alot when trying to figure out the newforms. http://code.pui.ch/2007/01/07/using-djangos-newforms/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: about newforms

2007-04-09 Thread Georgi Stanojevski
Christian Hoppner напиша: > I have noticed that the newforms documentation really lacks a lot so far. Not > to say it's useless, but it's not enough to teach me how to use it. > > I have already decided to manually generate the two forms I'll need for my > current project. So that's not the qu

Re: about newforms

2007-04-09 Thread nick feng
Hi Christian, Have you read the www.djangobook.com? I think it's better for you to read www.djangoproject.com/documentation/ It's will help you with every case of your project. Best Wishes, Nick - Original Message - From: "Christian Hoppner" <[EMAIL PROTECTED]> To: Sent: Tuesday, April

about newforms

2007-04-09 Thread Christian Hoppner
Hi there. I have noticed that the newforms documentation really lacks a lot so far. Not to say it's useless, but it's not enough to teach me how to use it. I have already decided to manually generate the two forms I'll need for my current project. So that's not the question. Now, what should

Re: newb: Sending Request to Django Dev Server, From Python Terminal

2007-04-09 Thread oggie rob
urllib.urlopen('http://127.0.0.1:8000/putProduct').read() On Apr 9, 9:09 am, "johnny" <[EMAIL PROTECTED]> wrote: > How do you send a request to localhost djanog dev server from Python > Terminal? > I have started mysql and python dev server locally on my machine. > Now, I want to open > python te

Integrating third parties script within django

2007-04-09 Thread Nicolas Steinmetz
Hello, I read Flickr Integration page on wiki [1] and I see that the third parties script FlickrClient was called through "from project.directory.file import module" I tried the same with another lib in my views.py file but it does not work : ViewDoesNotExist at / Could not import project.app.v

Re: newb: Sending Request to Django Dev Server, From Python Terminal

2007-04-09 Thread Paul Rauch
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 johnny schrieb: > How do you send a request to localhost djanog dev server from Python > Terminal? > I have started mysql and python dev server locally on my machine. > Now, I want to open > python terminal send a request, to 127.0.0.1:8000/putProduct

newb: Sending Request to Django Dev Server, From Python Terminal

2007-04-09 Thread johnny
How do you send a request to localhost djanog dev server from Python Terminal? I have started mysql and python dev server locally on my machine. Now, I want to open python terminal send a request, to 127.0.0.1:8000/putProduct. Thank you. --~--~-~--~~~---~--~~ You

A very useful website

2007-04-09 Thread adsf
A very useful website http://www.hotalways.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group,

Re: Django scaling and Database replication

2007-04-09 Thread Julio Nobrega
Yes, there's a way, but it's not in Django that you do this, but on the database. You don't need to configured Django (or any application accessing the database) to "talk" to slave hosts. It's the job of the database server software to abstract this step for you. You're going to setup slaves

Re: Parsing XML using dojo

2007-04-09 Thread Benjamin Slavin
Gali, This really has nothing to do with Django, so this is not the right place to ask. The answer you're looking for might be in the dojo documentation at http://dojotoolkit.org/docs/book. If that doesn't work you could check-out their forums http://dojotoolkit.org/forum - Ben On 4/9/07, Ga

Re: Index in admin

2007-04-09 Thread patrick k.
this question has been raised previously. if you search the mailing- list you will find some "answers". look for "move up/move down" ... if I remember this right, the answer was that this is "out of the scope" of django. you´ll also find some code here: models.py: http://dpaste.com/hold/4898/

Re: Index in admin

2007-04-09 Thread Martin
order_with_respect_to might be the solution, but it does not seem to work. /Martin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroup

Index in admin

2007-04-09 Thread Martin
Often you need to give the user control over the order of records in a table, and allow the user to move a record "up" or "down". This could be done by adding an index field to the table, and make a special view instead of using Django's admin view. Is that the way to accomplish this, or does Dja

Re: repository for SuSe

2007-04-09 Thread andrew cooke
When I update the repo I get security warnings about the repomd.xml file having changed since it was signed, but otherwise things seem to work now, thanks. Andrew > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > andrew cooke schrieb: >> >> Spoke too quickly - it failed to install: >> >> S

Re: Django scaling and Database replication

2007-04-09 Thread James Bennett
On 4/8/07, Merric Mercer <[EMAIL PROTECTED]> wrote: > However, I can't figure out how Django handles it. I can't see anything > in the documentation or the settings that would allow writes to be > handled by a different host to the reads. The idea with both load balancing and DB replication is t

Re: repository for SuSe

2007-04-09 Thread Paul Rauch
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 andrew cooke schrieb: > > Spoke too quickly - it failed to install: > > Subprocess failed. Error: RPM failed: error: /var/adm/mount/ > AP_0x0051/noarch/python-django-svn-4945-0.prauch. > 1.SuSE1020.noarch.rpm: Header V3 RSA/SHA1 signature: BAD,

Re: Jinja Backports

2007-04-09 Thread Armin Ronacher
Argh. Dammit :-/ That should be an reply to another thread. Regards, aRmin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com T