Re: *Occasional* PostgreSQL Error

2008-01-30 Thread James Bennett
On Jan 30, 2008 8:57 AM, Mark Green <[EMAIL PROTECTED]> wrote: > Well, "Build for failure". Temporary overload can happen at any > time and I'd expect django to behave exceptionally bad in that > case as it is. Running out of resources is never a good thing for any system. > Disclaimer: I

Re: Iterating over very large queryset

2008-01-30 Thread James Bennett
On Jan 30, 2008 10:21 AM, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Can you share any hints on how to reduce the memory usage in such > situation? The underlying database structure is rather complicated and I > would like to not do all queries manually. At this level -- hundreds of thousands of

Re: Simultaneous edits

2008-01-30 Thread James Bennett
On Jan 30, 2008 9:18 AM, Michael Hipp <[EMAIL PROTECTED]> wrote: > Does Django have any built-in way to handle or prevent simultaneous, > incompatible edits to a database record? No, that's what your database's concurrency handling is for. -- "Bureaucrat Conrad, you are technically correct --

Re: *Occasional* PostgreSQL Error

2008-01-29 Thread James Bennett
On Jan 29, 2008 11:18 PM, Mark Green <[EMAIL PROTECTED]> wrote: > I agree on the loadbalancer front but the overhead for all > those TCP connections (and pgpool managing them) worries me a bit. I've used pgpool in production with great success, so I'm not really sure what overhead you're talking

Re: *Occasional* PostgreSQL Error

2008-01-29 Thread James Bennett
On Jan 29, 2008 10:04 PM, Mark Green <[EMAIL PROTECTED]> wrote: > Just curious, what's the state of connection pooling in django? My personal opinion is that the application level (e.g., Django) is the wrong place for connection pooling and for the equivalent "front end" solution of load

Re: user.get_absolute_url()

2008-01-28 Thread James Bennett
On Jan 28, 2008 6:49 AM, Artiom Diomin <[EMAIL PROTECTED]> wrote: > For example in Middleware, in process_request. You could "monkeypatch" > User on the fly. Or he could use the standard, documented method for overriding a model's get_absolute_url() method:

Re: Multiple columns for db_indexes ?

2008-01-27 Thread James Bennett
On Jan 27, 2008 10:35 PM, Hugh Bien <[EMAIL PROTECTED]> wrote: > I've been googling around for a while, but I haven't found a way to create > indexes with multiple columns, ie. Several options: 1. Instead of 'syncdb', use the 'sqlall' option of manage.py and pipe the SQL into a file, then edit

Re: Multiple sites

2008-01-27 Thread James Bennett
A better solution: 1. Completely forget that you ever learned from any source that it might be a good idea to have a project folder with the apps inside it; the tutorial does that because it's simpler and easier for purposes of introducing Django, but in real-world situations it's generally a

Re: exists created_at or updated_at ?

2008-01-27 Thread James Bennett
On Jan 27, 2008 10:54 AM, Claudio Escudero <[EMAIL PROTECTED]> wrote: > Anyone know if there is something like created_at or updated_at of Ruby on > Rails. > These fields are filled automatically when saving and editing? For any DateField or DateTimeField, you can tell Django to automatically

Re: ForeignKey _id not so transparent

2008-01-26 Thread James Bennett
On Jan 26, 2008 11:36 PM, msoulier <[EMAIL PROTECTED]> wrote: > instance = models.ForeignKey(TugInstance) > > When my form is submitted, I am assigning > > client.instance = form.clean_data['instance_id'] You can assign a numeric ID of a TugInstance object to 'instance_id' on a Client object.

Re: Outputting individual fields of a Model form

2008-01-26 Thread James Bennett
On Jan 26, 2008 7:35 PM, almostvindiesel <[EMAIL PROTECTED]> wrote: > I figured {{ form['recipe_name'] }} or > {{ unicode(form['recipe_name']) }} should work per the documentation > here: http://www.djangoproject.com/documentation/newforms/, but doing > so returns the following error within the

Re: How do you filter fields from queries?

2008-01-23 Thread James Bennett
On Jan 23, 2008 4:38 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > In other words, how do I invoke a query and supply what is essentially > a column list in a SQL SELECT statement? By following the instructions in the nice documentation that's provided with Django:

Re: How I see the SQL generated in the system in development?

2008-01-23 Thread James Bennett
On Jan 23, 2008 9:17 AM, Claudio Escudero <[EMAIL PROTECTED]> wrote: > How I see the SQL generated in the system in development? > Its appears on the console? http://www.djangoproject.com/documentation/faq/#how-can-i-see-the-raw-sql-queries-django-is-running -- "Bureaucrat Conrad, you are

Re: Template Macros Like In Jinja

2008-01-22 Thread James Bennett
On Jan 22, 2008 4:15 PM, Papalagi Pakeha <[EMAIL PROTECTED]> wrote: > what's the reasoning behind not having and not planning to have macros > in django templates? they look like a very useful construct compliant > with DRY to me. Django's template system is meant to be a means of expressing

Re: Template Macros Like In Jinja

2008-01-22 Thread James Bennett
On Jan 21, 2008 8:30 PM, Papalagi Pakeha <[EMAIL PROTECTED]> wrote: > i wonder if there is any way to have Macros in django templates > similar to what Jinja has (http://jinja.pocoo.org/)? No. The Jinja project was started specifically to add additional programming constructs that the Django

Re: Tutorial03: question about efficiency

2008-01-22 Thread James Bennett
On Jan 22, 2008 8:16 AM, code_berzerker <[EMAIL PROTECTED]> wrote: > this gives 5 Poll objects. I wonder if this is efficient way of > getting them? Does django get all rows first and then sort it and then > slice it to get only 5? Or is it optimized somehow. The question is if > its simplified

Re: considering django for The Freesound Project, some (de)constructive critisism

2008-01-21 Thread James Bennett
On Jan 21, 2008 10:22 AM, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > 1. huge numbers of users make the admin almost unusable. Almost any > objects is related to a user (or two). Having to load 500K users in a > form makes for ultra big and slow web pages. Is there a fix for this >

Re: differences between runserver and apache

2008-01-21 Thread James Bennett
On Jan 21, 2008 8:43 AM, Carl Karsten <[EMAIL PROTECTED]> wrote: > Exception Type: ViewDoesNotExist at /admin/ > Exception Value: Tried new_message in module ridgemoor.core.views. Error was: > 'module' object has no attribute 'new_message' Most likely is that something that's different between

Re: Another database for unit tests

2008-01-19 Thread James Bennett
On Jan 19, 2008 10:24 PM, Jim Crossley <[EMAIL PROTECTED]> wrote: > Yes, I knew I could override the NAME, but I'd like to override the > ENGINE,USER,PASSWORD,HOST, and PORT, too. Our settings are configured > for mysql/innodb, to match our production environment. But as our > test suite and

Re: Another database for unit tests

2008-01-19 Thread James Bennett
On Jan 19, 2008 5:05 PM, Jim Crossley <[EMAIL PROTECTED]> wrote: > What's the common way of making unit tests use a different database > than what's in settings.DATABASE_{ENGINE,USER,PASSWORD,HOST,PORT}? http://www.djangoproject.com/documentation/settings/#test-database-name -- "Bureaucrat

Re: limit_choices_to in ModelForm

2008-01-19 Thread James Bennett
On Jan 19, 2008 3:51 AM, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > I have a limit_choices_to in my model - but this does work on my > ModelForm. How do I do this? Either set up the ModelChoiceField manually and specify the QuerySet, or hang on while I get around to adding tests to the patch

Re: Help tracking down runaway RAM

2008-01-18 Thread James Bennett
Do you have "DEBUG = True" in your Django settings file? -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: I think the django's froms js too complicated and not flexible , is there anybody agree?

2008-01-17 Thread James Bennett
On Jan 17, 2008 6:30 AM, maoxl <[EMAIL PROTECTED]> wrote: > writing a html form is just NOT so complicated, and I really don't > think it deserve a py package as luxury as the > django.contrib.newfroms . why not just write html forms by hand . > I'm a new comer to django, hoping somebody tell me

Re: Private (owner) vs. public records

2008-01-17 Thread James Bennett
On Jan 17, 2008 5:36 AM, Grindizer <[EMAIL PROTECTED]> wrote: > For example, i found this very handy, when we have to support a > multilingual db: getting the current language like this and use it to > select the right values in db can save us a lot of work, and result in > a more clear views

Re: Private (owner) vs. public records

2008-01-17 Thread James Bennett
On Jan 17, 2008 5:00 AM, Grindizer <[EMAIL PROTECTED]> wrote: > - If you want to retrieve the current logged user at model level, this > is a little more complicated, because models are note designed to see > what happen at process level, but it still possible, look at this: Any code which

Re: These waters aren't so friendly after all

2008-01-16 Thread James Bennett
Again, folks: please don't rise to the bait ;) -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: These waters aren't so friendly after all

2008-01-16 Thread James Bennett
Ladies and gents, you'll do everyone a favor if you don't rise to the bait here. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: [beginner] Commonly used variables.

2008-01-15 Thread James Bennett
It's worth noting that I expanded that a bit and put it into my "template_utils" app: http://code.google.com/p/django-template-utils/ Sent from my iPod On Jan 15, 2008, at 7:46 PM, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > > > On 16-Jan-08, at 3:26 AM, Petar wrote: > >> The thing

Re: One to many issue in Django admin

2008-01-15 Thread James Bennett
On Jan 15, 2008 9:34 PM, oak <[EMAIL PROTECTED]> wrote: > In Django admin I can add a track without specifying a file without a > problem however if I go into album and try to add a track that way. It > has an error saying that the file can not be null. It looks like you initially created the

Re: A bug (I'm being rejected from submitting a ticket, as it thinks I'm a spammer. I'M NOT!

2008-01-15 Thread James Bennett
On Jan 15, 2008 9:12 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I know I should have sent it using a ticket, but I'm being rejected > for some reason as a spammer. Hope this one will go throgh. Quoting from the "New ticket" page: "If you're getting rejected by the spam filter, we

Re: Django Performance

2008-01-15 Thread James Bennett
On Jan 15, 2008 10:07 AM, Sadjad Fouladi <[EMAIL PROTECTED]> wrote: > I have a question. I'm going to use Django for my new website. Can I > use django in a shared hosting environment or I need to buy a > Dedicated server? Does Django need a lot of RAM, like Rails? Please > note that, this site

Re: Problem with Css and django template

2008-01-15 Thread James Bennett
On Jan 15, 2008 1:08 AM, laspal <[EMAIL PROTECTED]> wrote: This: > (r'^static/(?P.*)$', 'django.views.static.serve', > {'document_root': '/home/laspal/trytemplate/Template/', > 'show_indexes' : True}), Does not match the URL in this: > type="text/css" href="testing1.css" /> So change one

Re: file upload RAM buffer or stream to tmp

2008-01-14 Thread James Bennett
On Jan 14, 2008 12:01 PM, Vance Dubberly <[EMAIL PROTECTED]> wrote: > Kind of a bummer, guess I'll be using cherrypy for this project. Was > hoping to use django but it looks like there is no way to hook into > the request response loop before the request is parsed. :( If streaming uploads are

Re: dynamic choices in a ChoiceField

2008-01-13 Thread James Bennett
2008/1/13 Alex Koshelev <[EMAIL PROTECTED]>: > When you explicitly write list in choices it evaluates at module > import type. To avoid this write function and pass it as 'choices' > parameter Or... deck = forms.ModelChoiceField(queryset=Deck.objects.all()) -- "Bureaucrat Conrad, you are

Re: Auto login

2008-01-11 Thread James Bennett
On Jan 11, 2008 8:51 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > How do I get access to that backend? The Django auth documentation covers this; look at the note on the documentation for the 'login()' function (in the section on how to log a user in manually). -- "Bureaucrat Conrad,

Re: #! ??

2008-01-11 Thread James Bennett
On Jan 11, 2008 9:03 PM, kbochert <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] public_html]# ./tmp3 > -bash: ./tmp3: /usr/local/bin/python2.5^M: bad interpreter: No such > file or directory Try running 'dos2unix' on that file to convert the line endings to the proper Unix style. --

Re: How are the ids for Django models calculated?

2008-01-11 Thread James Bennett
On Jan 11, 2008 11:02 AM, shabda <[EMAIL PROTECTED]> wrote: > How are the values calculated. If Django asks the DB to provide it > those values, can we be sure, for all supported backends, that > 1. The ids are auto incrementing, (and not just unique). > 2. They start from zero. > 3. The

Re: django-registration mysterious errror

2008-01-10 Thread James Bennett
On Jan 10, 2008 9:14 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Unless I've gone utterly mad, it IS django-registration. I remember > installing django-registration, and most all of the code looks just > like django-registration, albeit an older version. Not that any of > that explains

Re: django-registration mysterious errror

2008-01-10 Thread James Bennett
On Jan 10, 2008 2:51 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > File "/home/grmadmin/webapps/django/classic/registration/views.py", > line 35, in activate >account.backend = 'django.contrib.auth.backends.ModelBackend' There is not and never has been any such line of code in

Re: Print view

2008-01-08 Thread James Bennett
On Jan 8, 2008 6:27 PM, Jeff Anderson <[EMAIL PROTECTED]> wrote: > The only way I know to accomplish this is to modify the admin template, > and display a link based on the name of the model, as determined by the > template logic. > Is this the best way to do this? or is there a cleaner way?

Re: anyone have luck with http://code.google.com/p/django-pyodbc/

2008-01-08 Thread James Bennett
Python module names cannot include hyphens, so 'django-pyodbc.db.mssql' is not a valid Python module name regardless of whether you have the code on your system. Try renaming the module to not include a hyphen. Also, make sure you're using a recent SVN checkout of Django; the ability to use

Re: read only in Admin interface

2008-01-08 Thread James Bennett
On Jan 8, 2008 12:14 PM, Jeff Anderson <[EMAIL PROTECTED]> wrote: > Another dirty solution would be to simply create a user account, and > give it permissions to only view things. I haven't played with > permissions at all, but I imagine it would be possible. > The correct way is still to write

Re: Adding a request.user to a ModelForm instance

2008-01-08 Thread James Bennett
On Jan 8, 2008 11:16 AM, l5x <[EMAIL PROTECTED]> wrote: > This should help you: > http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser No. That's a nasty, ugly, horrible hack that's about fifty times more complicated than what's actually needed to do this. He got it right the first

Re: read only in Admin interface

2008-01-08 Thread James Bennett
On Jan 8, 2008 10:17 AM, Nader <[EMAIL PROTECTED]> wrote: > I have looked while for a answer to my problem but unfortunately I > haven't found a one, maybe I had to spend more time. However I have a > project with some applications. By using of Admin we can Create, Read, > Update and Delete

Re: Adding a request.user to a ModelForm instance

2008-01-08 Thread James Bennett
On Jan 7, 2008 8:03 PM, Car <[EMAIL PROTECTED]> wrote: > Is it possible to add field formerly excluded in ModelForm in view > like in this example below: Yes, but you're not "adding a field". You're simply getting back a model object and then you're 100% done with the ModelForm. What you do with

Re: Context processor a bit too helpful

2008-01-08 Thread James Bennett
On Jan 8, 2008 12:47 AM, Michael Hipp <[EMAIL PROTECTED]> wrote: > How do I say "no thanks" to this helpfulness so my html can to thru? By reading the Django template documentation, which covers this in some detail. -- "Bureaucrat Conrad, you are technically correct -- the best kind of

Re: How to refer to a class defined later in the file

2008-01-07 Thread James Bennett
On Jan 7, 2008 7:59 AM, shabda <[EMAIL PROTECTED]> wrote: > This line gives me an error, > revision_for = models.ForeignKey(Page, related_name = 'revision_for') > as NameError: name 'Page' is not defined, obviously because page is > defined later in the file. I can not put PageRevision later as

Re: How to check which view got called by a request

2008-01-02 Thread James Bennett
On Jan 2, 2008 4:09 PM, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > It doesn't seem to be possible to work out the exact Python function > that was called (the necessary information isn't always available, since > it could, for example, be a middleware function that short-circuited > things).

Re: Getting exception 'User' object has no attribute 'backend'

2008-01-02 Thread James Bennett
On Jan 2, 2008 1:57 PM, shabda <[EMAIL PROTECTED]> wrote: > I have this code, > from django.contrib.auth import login > user = User.objects.get(username = > login_form.cleaned_data['username']) > login(request, user) > Which is giving me exception 'User' object

Re: Raising Http Redirect

2008-01-02 Thread James Bennett
On Jan 2, 2008 9:37 AM, Thomas Guettler <[EMAIL PROTECTED]> wrote: > If someone tries to save a form, but someone else was faster, > then I want to leave the slower person a message, and redirect him to > the form again. His changes will be lost. Why not return a validation error from the form

Re: Raising Http Redirect

2008-01-02 Thread James Bennett
On Jan 2, 2008 8:20 AM, Forest Bond <[EMAIL PROTECTED]> wrote: > I disagree. Exceptions represent "exceptional situations," not all of which > are > necessarily errors. For instance, SystemExit is not really an error, is it? > What about StopIteration? By that analogy as well, exceptions

Re: update to the latest Django by svn, but serveral error comes...

2008-01-02 Thread James Bennett
As always, your questions are answered by the well-maintained list of backwards-incompatible changes: http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges Specifically, you want to read this:

Re: Raising Http Redirect

2008-01-02 Thread James Bennett
On Jan 2, 2008 3:49 AM, Thomas Guettler <[EMAIL PROTECTED]> wrote: > The HTTP return codes 404 and 500 can be raised with an exception. > > That's very handy. Unfortunately a Http Redirect can't be raised. > Do other django users thing this would be usefull, too? No. Exceptions represent

Re: django.contrib.auth.views.password_change

2008-01-01 Thread James Bennett
On Jan 1, 2008 8:01 PM, ocgstyles <[EMAIL PROTECTED]> wrote: > {{ form.as_table }} > > to print out the fields, but that's not happening. Any idea why? Because not all components of Django have yet been rewritten to use the newforms library; the fact that the form used here is defined by

Re: Django (SVN-Version) doesn't execute raw sql-queries

2007-12-29 Thread James Bennett
On Dec 29, 2007 7:18 AM, beewee <[EMAIL PROTECTED]> wrote: > it works now when calling the connection._commit() function (which is > completely undocumentated) after executing the query. (I know that you > shouldn't call functions starting with _ in general) Were you doing anything to disable

Re: Cannot assign requested address

2007-12-27 Thread James Bennett
On Dec 27, 2007 6:01 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > It seems that this error was coming from HttpResponseRedirect() of the > contact view method, but I did not figure what went wrong. No, look at the traceback. The lines it's highlighting are the ones which send the email,

Re: [Q] Django API documents?

2007-12-24 Thread James Bennett
On Dec 24, 2007 11:37 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I am relatively new to Django and Python programming. Is there an API > documents in Django similar to JavaDoc? When I do programming in > Java, I can easily look up the JavaDoc to figure out method arguments > etc. I

Re: noob question - Feedparser / Template_Utils / time filters

2007-12-23 Thread James Bennett
On Dec 23, 2007 11:06 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Using modified_parsed gave me this date (2007, 12, 21, 21, 22, 49, 4, > 355, 0) but threw an error when applying a filter: AttributeError > at / 'time.struct_time' object has no attribute 'year' > > I think I am just not

Re: noob question - Feedparser / Template_Utils / time filters

2007-12-23 Thread James Bennett
On Dec 23, 2007 10:19 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > That all works - (renders as Fri, 21 Dec 2007 21:22:49 + ) but I > can not apply any Django time filters (date, timesince, naturalday) to > the {{entry.date }} variable. I would guess it is not recognizing the > date as

Re: How to make fields with editable=False visible in the Admin interface

2007-12-20 Thread James Bennett
On Dec 20, 2007 9:03 AM, GodOfGeeks <[EMAIL PROTECTED]> wrote: > The problem is that when I set the fields to editable=False then they > won't be visible in the adminModel The admin interface is deliberately designed not to have "display-only" data -- the thinking has been that things which

Re: Admin-editable configuration for Django?

2007-12-20 Thread James Bennett
On Dec 20, 2007 4:55 AM, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > While this might work for the options I defined by myself, the standard > settings options "should not be changed in runtime" (according to docs). > Did anybody manage to solve this issue? Have you looked at Marty's dbsettings

Re: i18n/setlang no longer support GET

2007-12-19 Thread James Bennett
On Dec 19, 2007 12:59 PM, Poromenos <[EMAIL PROTECTED]> wrote: > My application's UI depends on the set_language view being a link, and > I don't think it should be up to the framework to force this on the > developer. It would be better if the view supported both ways and the > developer could

Re: Allowing downloads for only certain users

2007-12-18 Thread James Bennett
On Dec 18, 2007 3:50 PM, Ryan K <[EMAIL PROTECTED]> wrote: > What is the best way to serve static media and only letting certain > users (using django.contrib.auth) download that data? http://www.djangoproject.com/documentation/apache_auth/ -- "Bureaucrat Conrad, you are technically correct

Re: Simple Database Import Memory Problems

2007-12-18 Thread James Bennett
On Dec 18, 2007 9:57 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > That's really all it does. If you watch it in top, however, python's > memory consumption rises steadily as the file is processed (f is very > large, so there are many iterations of the loop). I was wondering if > anyone

Re: Template text are not being escaped when used with textile

2007-12-18 Thread James Bennett
On Dec 18, 2007 8:56 AM, shabda <[EMAIL PROTECTED]> wrote: > I am using textile markup filter. When I am using a variable in the > template without any filter they are being auto escaped, as they > should. However, if I use any markup filter like textile or markdown, > the text is not being auto

Re: How to get the urls defined in urls.py

2007-12-18 Thread James Bennett
On Dec 18, 2007 8:10 AM, shabda <[EMAIL PROTECTED]> wrote: > Now from a template i need to access these urls. So inside the > template we can refer them as /foo/, /bar/. However later when I > change the urls.py, these urls defined in urls.py would break. What > would be a good way around this?

Re: Templates, filesystem, caching?

2007-12-17 Thread James Bennett
On Dec 17, 2007 4:03 PM, Rob Hudson <[EMAIL PROTECTED]> wrote: > If I understand correctly, these cache the templates after they have > been rendered. What I'm curious about is if there is a way to cache > templates before they are rendered so you can provide different > contexts to them. It

Re: Is it possible to create a related model from within another save() method?

2007-12-15 Thread James Bennett
On Dec 15, 2007 4:10 AM, Andrew <[EMAIL PROTECTED]> wrote: > I've implemented a generic "change" model for some of my models. > Ideally what I'd like is to be able to either mark or subclass a > model, and when changes are made to a specific field, a copy is saved > in the related "change" object

Re: Should not ModelObj.objects.get() have a .values method?

2007-12-15 Thread James Bennett
On Dec 15, 2007 9:35 AM, shabda <[EMAIL PROTECTED]> wrote: > Should not the object returned by .get() have > a .values method? No, because -- as the documentation clearly states -- get() returns a single model object. Only methods which return a QuerySet will have a values() method, because

Re: Foreignkey / Relationship / Views

2007-12-14 Thread James Bennett
On Dec 14, 2007 2:08 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > My problem is how to retrieve all appointment details in a view for > the current user, suppose he has got the user_id = 1. Appointment.objects.filter(appointmentparticipant__participant_user__pk=request.user.id) --

Re: Signals: Server ready to server first request.

2007-12-14 Thread James Bennett
Welcome to "James pimps his blog": http://www.b-list.org/weblog/2007/nov/05/server-startup/ -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Putting django on Amazon DB

2007-12-14 Thread James Bennett
On Dec 14, 2007 1:05 PM, John M <[EMAIL PROTECTED]> wrote: > I know the developers for django are pretty busy, but how hard would > it be to put this simple DB into django? Django has the ability to use a database backend not defined as part of Django itself, so the best plan for this would be

Re: Error: list index out of range

2007-12-14 Thread James Bennett
On Dec 14, 2007 8:06 AM, Julien <[EMAIL PROTECTED]> wrote: > Thanks James for the tips. However I think that my app is not generic > enough to be on the Python path. Generic has nothing to do with it; unless you have extremely compelling reasons for tying the app to the project, simply don't do

Re: Django Development Server question - not "refreshing data"

2007-12-13 Thread James Bennett
On Dec 13, 2007 10:04 PM, subgiambi <[EMAIL PROTECTED]> wrote: > and I can access my site at http://127.0.0.1:8000/ fine. However when > I, for example, use the website interface to change a user's profile > by altering the user's "City" - even if I refresh the new City is not > displayed on the

Re: Problems with initial data

2007-12-13 Thread James Bennett
On Dec 13, 2007 2:14 PM, Tane Piper <[EMAIL PROTECTED]> wrote: > So, I modified it so each import is a function, and each has it's own > dispatcher with a sender (being IssueType, IssueSeverity and > IssueStatus) - however when the models are created they don't get > called. Take the sender away

Re: Problems with initial data

2007-12-13 Thread James Bennett
On Dec 13, 2007 10:36 AM, Tane Piper <[EMAIL PROTECTED]> wrote: > dispatcher.connect(init_issues_database, signal=signals.post_syncdb) This will set up the code to run every single time an application is installed. Not just the application it resides in, but *every* application. You want to look

Re: Database

2007-12-11 Thread James Bennett
On Dec 11, 2007 7:57 PM, Goldy <[EMAIL PROTECTED]> wrote: > My Django database was created using sqlite3 and therefore produced a > file called mydb.py. > I was wondering if this file could be connected to and examined > interactively by sqlite3 as if i had inserted the tables myself? Why

Re: Performance of a django website

2007-12-11 Thread James Bennett
On Dec 11, 2007 1:28 PM, Richard Coleman <[EMAIL PROTECTED]> wrote: > I have maxclients set to 1000, but the number of apache processes never > gets close to that value. I've played around with various settings for > maxclient, but as long as I don't set it too low, this never comes into > play.

Re: static on separate what?

2007-12-08 Thread James Bennett
On Dec 8, 2007 10:57 PM, Carl Karsten <[EMAIL PROTECTED]> wrote: > I this text, does "separate Web server" contingent on a 2nd box? If it is > only > one box, the same Apache instance would be preferred, right? No, and no. You don't have to have separate physical machines, but the recommended

Re: Created a new class...doesn't manually create the ManytoMany table for me?

2007-12-08 Thread James Bennett
On Dec 8, 2007 8:36 PM, Greg <[EMAIL PROTECTED]> wrote: > The problem arises when I do a 'python manage.py syncdb'. I would of > thought that command would create my new manytomany table. Something > like 'app_collection_specials'. Do I have to manually create that > table? Yes. Once syncdb

Re: creating an inline comma-separated list

2007-12-07 Thread James Bennett
On Dec 8, 2007 12:28 AM, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: > Hope the formatting survives. I have two questions: > > 1. Is there really no easier way to do this? > 2. I'm up against the negative indexing problem in getting the last > author, and while the negative order_by seems okay,

Re: Distributing Updates

2007-12-07 Thread James Bennett
On Dec 7, 2007 10:16 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > This quite literally is the only thing that's keeping me from going > with Django and not looking back, but I really can't bother my clients > with having to walk them through opening a database and adding new > columns and

Re: "Between" bug when using SQLite?

2007-12-05 Thread James Bennett
On Dec 5, 2007 9:56 PM, Doug Van Horn <[EMAIL PROTECTED]> wrote: > I opened: > > http://code.djangoproject.com/ticket/6141 I didn't see this until just now, but it's actually an issue that's already been reported. I've closed your ticket as a duplicate, with a pointer to the original report (and

Re: Combating submission form Spam

2007-12-05 Thread James Bennett
On Dec 5, 2007 6:50 PM, Darryl Ross <[EMAIL PROTECTED]> wrote: > One of the websites I run has started getting spam via the contact form. > > What is the recommended way of dealing with this? Do I need to go the > route of using something like django-captcha? Shameless plug: my contact-form

Re: Django Book

2007-12-05 Thread James Bennett
On Dec 5, 2007 8:41 PM, etank <[EMAIL PROTECTED]> wrote: > Is the code for the http://www.djangobook.com/en/beta/ available > anywhere for download? I am wanting to write some documentation for > Foresight Linux and I like the way that this site works. Any help that > you provide would be great.

Re: View permission for models in the admin

2007-12-05 Thread James Bennett
On 12/5/07, Percy Rodriguez <[EMAIL PROTECTED]> wrote: > I have a few users with is_staff = True and they can't see any models > they don't > have explicit permissions for. I even tried to access other models and > I get a > "Permission denied" error. Giving any permission -- add, change or

Re: Why are 'greater than', 'less than's getting rendered as HTML entities?

2007-12-04 Thread James Bennett
On 12/4/07, JHeasly <[EMAIL PROTECTED]> wrote: > it works as expected. So it seems something in the templating response > food chain is converting the greater than's/less than's(?). > > What is the obvious thing I'm missing? You're going against the strong recommendation of the Django project,

Re: Cannot resolve keyword 'userprofile' into field.

2007-12-03 Thread James Bennett
On 12/3/07, gkelly <[EMAIL PROTECTED]> wrote: > I'm getting the following Traceback sporadically (using Django 0.96 > and mod_python on linux). > I can hit refresh and the page comes up fine, but sometimes this error > will happen again (as if some httpd children pass and some fail). You're

Re: Using raw SQL with filter-support (or: speeding up MySQL views)

2007-12-03 Thread James Bennett
On 12/3/07, Karen Tracey <[EMAIL PROTECTED]> wrote: > I don't know how to go from raw sql to a QuerySet. My own custom managers > start with a model's default QuerySet and modify it using the standard > exclude(), etc. There are two ways to go from raw SQL to Django model objects. One results

Re: Support for Federated MySql table?

2007-11-30 Thread James Bennett
On 11/30/07, Gloria W <[EMAIL PROTECTED]> wrote: > The problem I have is that the manage.py inspectdb dumps a table which > matches my sql table in construct, but no info about being federated. > So an objects.filter() on some of these fields is failing, although I > can see the fields when I

Re: IRC Channel

2007-11-29 Thread James Bennett
On 11/29/07, David Reynolds <[EMAIL PROTECTED]> wrote: > Seems like someone asked for it?! > > Very confused about this.. Originally anyone could change the topic. This apparently led to a problem where troublemakers would come in and change the topic randomly, and a freenode staff member

Re: Model.validate() bug???

2007-11-28 Thread James Bennett
On 11/28/07, wiswaud <[EMAIL PROTECTED]> wrote: > So i just create a new object, like f=Foo(), and fill in the fields > based on which ones were present in the input data. > > Then i call f.validate(). Model validation is a work in progress, and is nowhere near being usable (something that a

Re: user restrictions in admin interface

2007-11-27 Thread James Bennett
On 11/27/07, sam <[EMAIL PROTECTED]> wrote: > I would like that all users logged could modify the title and content > field (in the standard django admin) > and I would like that just a category of user can modify the > publish_status (always in the standard django admin). You will not be able

Re: Error while importing URLconf

2007-11-27 Thread James Bennett
On 11/27/07, Sun Wukong <[EMAIL PROTECTED]> wrote: > But I get this error : > Error while importing URLconf 'myblog.personne.urls': cannot import name > render_to_reponse One of your views is trying to use render_to_response, but is apparently looking in the wrong place to import it. --

Re: Cuztomizing the admin interface.

2007-11-24 Thread James Bennett
On 11/23/07, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > you will have to hack admin for this - it is better not to do this as > admin is going to change very soon into newforms-admin. It is better > to do this outside admin - I know it involves writing 3 extra lines > of template code to

Re: validating fields with newforms - part 2

2007-11-23 Thread James Bennett
On 11/23/07, Wolfram Kriesing <[EMAIL PROTECTED]> wrote: > looks cleaner in my eyes. opinions please! In my opinion, you're asking for a lot of custom behavior from a default field type, and the fact that you have to do some custom coding to support that custom behavior is not a bug ;) --

Re: Custom model validator

2007-11-23 Thread James Bennett
On 11/23/07, Bit Blazer <[EMAIL PROTECTED]> wrote: > When I am trying to test this model from shell, it's just saving the > data without any error messages when it is invalid. I don't know whats > wrong in the code above. Any suggestions how can I fix this? Validation is not (at the moment)

Re: newforms - How to add class attribute for the text field.

2007-11-23 Thread James Bennett
On 11/23/07, Nicholas Ding <[EMAIL PROTECTED]> wrote: > Any ideas? http://www.djangoproject.com/documentation/newforms/#widgets -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ You received this message

Re: Class Attribute in New Forms Input Elements

2007-11-21 Thread James Bennett
On 11/21/07, Cristian <[EMAIL PROTECTED]> wrote: > Thanks for the info. Unfortunately, I forgot to mention key point > (absentminded me) that I'm using the form_for_model function to create > many of these Form classes. Since I create many of these Form classes > on the fly, is there another way

Re: Deploying django with mysql cluster?

2007-11-21 Thread James Bennett
On 11/21/07, Richard Coleman <[EMAIL PROTECTED]> wrote: > Does anyone have experience with using django and mysql cluster? Do we > need to modify django to handle this? Any words of wisdom? I haven't actually done it myself, but as far as I know it's a matter of: 1. Don't use syncdb to create

<    2   3   4   5   6   7   8   9   10   11   >