Re: Request data accesible to _pre_save??

2005-09-12 Thread Jacob Kaplan-Moss
On Sep 12, 2005, at 3:40 PM, Alberto Valverde wrote: Firts of all, great software that's been keeping nearly without sleep for 3 days :) I'm building my first app with django and I'm stuck at one point: I want to be able to store de current user (the one that's logged in the admin area) in an

Re: Packaging django apps

2005-09-13 Thread Jacob Kaplan-Moss
On Sep 12, 2005, at 9:07 PM, [EMAIL PROTECTED] wrote: What if we, the community, created our own site. djangoapps.com or something. It would allow people to upload there own django apps. People could rate and comment on the apps posted there. And it would of course be written using django.

Re: Ordering by foreign key results in FieldDoesNotExist-Error

2005-09-13 Thread Jacob Kaplan-Moss
Hey Andreas -- I actually ran into this same problem myself today. It appears to be a bug in the admin changelist view; until I get a chance to actually track it down you can work around it by adding a "ordering" option to your META.admin:: class FirstChild(meta.Model): ...

Re: Generic views - problem(s)

2005-09-17 Thread Jacob Kaplan-Moss
On Sep 17, 2005, at 8:14 AM, PythonistL wrote: registrations.get_list(order_by=['Email'], limit=35) that it can be used in 'extra_lookup_kwargs'syntax ? extra_lookup_kwargs = { 'order_by' : ['Email'], 'limit': 15, } 2. How can I use the result of the query in my templates?

Re: Strange problem with dates after importing django models

2005-09-17 Thread Jacob Kaplan-Moss
On Sep 17, 2005, at 6:27 PM, [EMAIL PROTECTED] wrote: datetime.now() seems to be offset by 6 hours backwards after I import one of my django models: import datetime datetime.datetime.now() datetime.datetime(2005, 9, 18, 0, 21, 16, 456425) import django.models.sitecontent datetime.datet

Re: selecting specific fields

2005-09-20 Thread Jacob Kaplan-Moss
On Sep 20, 2005, at 6:37 AM, Kenneth Gonsalves wrote: how do i select specific fields from a table? table: name - varchar, address - varchar, zip - varchar i want the equivalent of: 'select name, address from table' The function you're looking for is ``get_values``:: >>> from django.

Re: Design Advice: "here" in Navigation

2005-09-20 Thread Jacob Kaplan-Moss
On Sep 20, 2005, at 8:31 AM, [EMAIL PROTECTED] wrote: In a template tag, can I get request.path from the context object? Since I'm going to use this everywhere, I don't want to put the code is a custom view. No, template tags do not have access to the request object (because you might be

Re: selecting specific fields

2005-09-20 Thread Jacob Kaplan-Moss
On Sep 21, 2005, at 12:36 AM, Kenneth Gonsalves wrote: thanks, that worked, now a new problem arises. how do i do a subselect to get the 'name' value of a foreign key field using get_values? http://www.djangoproject.com/documentation/db_api/#select Jacob

Re: selecting specific fields

2005-09-21 Thread Jacob Kaplan-Moss
On Sep 21, 2005, at 4:56 AM, Kenneth Gonsalves wrote: doesnt work with 'get_values'. Ah, so it doesn't -- that's a bug, which I've filed and hopefully will be fixed shortly: http://code.djangoproject.com/ticket/532 Also i find that i have to put the full table name as it appears in the

Re: how do you pronounce 'Django'

2005-09-26 Thread Jacob Kaplan-Moss
On Sep 26, 2005, at 6:46 AM, Gábor Farkas wrote: how do you pronounce 'Django'? Have you checked the FAQ? http://www.djangoproject.com/documentation/faq/#what-does-django-mean- and-how-do-you-pronounce-it Jacob

Re: Suggested doc updates

2005-09-27 Thread Jacob Kaplan-Moss
On Sep 27, 2005, at 4:24 AM, quentinsf wrote: As a newbie learning Django (and being thoroughly impressed, by the way), I've come across a few places where the documentation is rather thin (or I haven't found the right bit). I'm keen to help where I can, so thought I might add to the wiki, b

Re: Surving Static Files on Django

2005-09-28 Thread Jacob Kaplan-Moss
On Sep 28, 2005, at 2:48 PM, Jakub Labath wrote: 1. No it doesn't have to be external web server. However, if you have the resources, it really should be another server -- or at least another instance of Apache running on the same server. Why? In case you hadn't noticed, Django has a pr

Re: Concurrent-request memory footprints (was Surving Static Files on Django)

2005-09-28 Thread Jacob Kaplan-Moss
On Sep 28, 2005, at 3:38 PM, Jeremy Dunck wrote: On 9/28/05, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote: ...In case you hadn't noticed, Django has a pretty large memory footprint; between Apache, mod_python, Python, the database drivers, etc., Apache server processes tend to weig

Re: Surving Static Files on Django

2005-09-29 Thread Jacob Kaplan-Moss
On Sep 29, 2005, at 8:03 AM, Simon Willison wrote: That's more a limitation of mod_python than of Django itself. I imagine that FastCGI and SCGI avoid this issue almost entirely - the modules themselves are much smaller so it's less wasteful to use them to serve static files as well as Djan

Re: Performance and scalability

2005-09-29 Thread Jacob Kaplan-Moss
On Sep 29, 2005, at 10:31 AM, Adrian Holovaty wrote: Heh, KUsports.com has used that PHP message board for *years*, and we just haven't had the time (or inclination, really) to convert it to Django. There's no technical reason why it couldn't use Django -- indeed, Django is very good at forum-st

Re: Javascripts for forms, onchange etc

2005-09-29 Thread Jacob Kaplan-Moss
On Sep 29, 2005, at 8:50 AM, [EMAIL PROTECTED] wrote: My app has a Questions Module which has related Module Answers edited inline (just like in django admin) Questions can be correct or incorrect and only one question can be correct for each question. Whjat I'd like to do is implement a java

Re: Performance and scalability

2005-09-29 Thread Jacob Kaplan-Moss
On Sep 29, 2005, at 1:13 PM, Jeremy Dunck wrote: For clarity, which is the board that nearly brings you down? UBB -- http://boards.kusports.com/ is the site. It's on a seperate server because because UBB is an insecure, inefficient, bug ridden piece of shit. Jacob

Django hosting, anyone?

2005-09-30 Thread Jacob Kaplan-Moss
Hello fellow Djangonauts -- I've been thinking about launching a managed Django hosting service; is anyone interested? The big benefit Django hackers would get from such a service would be that the LAPD (Linux/Apache/Postgres/Django) stack would be fully set up when you signed up, so the

Re: Site-wide User Authentication

2005-10-04 Thread Jacob Kaplan-Moss
On Oct 4, 2005, at 8:42 AM, Andreas wrote: What's the best way to check if a user is logged in on every page (read: view) of a website? I'd like to be able to display the username in the template if a user is logged in. At the moment, I'm using the following code: If you use django.core.extens

Re: Template guide -> administration feature.

2005-10-04 Thread Jacob Kaplan-Moss
On Oct 4, 2005, at 3:20 PM, JKR wrote: In the template guide, there is a statement that referring to feature in administration interface. """ Because Django can be used to develop any sort of site, the tags, filters and variables available are different depending on the application. To make it

Re: Performance and scalability

2005-10-05 Thread Jacob Kaplan-Moss
On Oct 3, 2005, at 11:14 PM, Jimmie Houchin wrote: Can you tell us what kind of hardware is supporting that 100k? Our main production platform is three servers: a database server, a web server, and a media server. They're all Dual Xeons with 2G of RAM. We've got a secondary server setu

Re: memcached client

2005-10-07 Thread Jacob Kaplan-Moss
I've been told that the tummy memcached client is a little better than the danga one, but I've not yet tried it out and I'm not sure if it works with Django's cache framework. As far as I can tell the API hasn't changed so it should work transparently, though. Jacob

Re: Surving Static Files on Django

2005-10-13 Thread Jacob Kaplan-Moss
On Oct 13, 2005, at 7:15 AM, Sune Kirkeby wrote: On 9/29/05, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote: To pick one example: in a dynamic serving situation, KeepAlive is your friend; [ snip a lot ] Hmmm... HTTP Keep-Alive? Then either I'm misunderstanding you, or everything

Re: "runserver" vs. "runserver :" : a bug?

2005-10-15 Thread Jacob Kaplan-Moss
On Oct 15, 2005, at 4:07 PM, Emanuele wrote: Is it a correct behaviour? I look for it in the docs but I found nothing. Is it a bug? This is by design; runserver binds to localhost only by default. Jacob

Re: Tag Library questions

2005-10-31 Thread Jacob Kaplan-Moss
On Oct 31, 2005, at 7:30 AM, rockmh wrote: I downloaded and installed the blog app from the django_website area. However the main view is failing since tag library comments.comments is not found. You need to make sure that "django.contrib.comments" is in your INSTALLED_APPS. Jacob

Re: runserver problem

2005-11-03 Thread Jacob Kaplan-Moss
On Nov 3, 2005, at 6:04 AM, stava wrote: Now, when I save my model file (which causes runserver to reload the model) I get the following: [snip] Yeah, this is a known bug in the auto-reload stuff (or in the runserver command) -- see http://code.djangoproject.com/ticket/698. It's been left

Re: model for database view

2005-11-03 Thread Jacob Kaplan-Moss
On Nov 3, 2005, at 7:41 AM, stava wrote: I'm thinking of using a model for a database view (for convinience). Is there anyway one could set anything int the META of a model to tell it *not* to create a database table when doing a "django-admin sqlreset", or do I have to manually filter out the

Re: Using API to bulk populate data

2005-11-07 Thread Jacob Kaplan-Moss
I do, however, see methods for **set_relatedclass** when I dir the primary class. The documentation, to the best of my knowledge, doesn't mention how to use these methods. Check out http://www.djangoproject.com/documentation/models/ many_to_many/. The basic syntax is ``obj.set_realtedclasse

Re: How does feedparser.py parse the CDATA (html) data?

2005-11-08 Thread Jacob Kaplan-Moss
Hey Stan -- I think you're in the wrong place; this is the discussion group for Django; you probably want to ask this question at http:// feedparser.org/. Jacob

Re: understanding regroup

2005-11-15 Thread Jacob Kaplan-Moss
On Nov 15, 2005, at 2:15 AM, Sean Perry wrote: The {% regroup %} tag looked promising, but I can not get it to work. {% regroup user.get_thing_list|dictsort:"category" by category as grouped %} You have to group by actual fields (and not relationship names), so to Things by Category yo

Re: DRY templates

2005-11-15 Thread Jacob Kaplan-Moss
On Nov 15, 2005, at 5:09 PM, oggie rob wrote: But when I get to the template, no scalable option is obvious. I would expect something like: (% for field in form.fields %) [snip] As of revision [1253] this is now possible. Enjoy! Jacob

ANN: Django 0.90 is available

2005-11-15 Thread Jacob Kaplan-Moss
Hey folks -- We've wrapped up a 0.90 release of Django; let the Subversion-less rejoice! http://www.djangoproject.com/weblog/2005/nov/16/ firstrelease/ has the full details, but suffice to say that we've now got a tarball (and and egg for those who are into that sort of thing). Enjoy! J

Re: When will there be a Oracle Backend?

2005-11-16 Thread Jacob Kaplan-Moss
On Nov 16, 2005, at 7:04 AM, Pash wrote: i saw a Ticket about an Oracle Backend. When will it be implemented in Django? :) IIRC there are a few pretty major differences between Oracle and other RDBMSes that are preventing a Oracle backend from being "easy". I'll reinstall Oracle and take

Re: When will there be a Oracle Backend?

2005-11-16 Thread Jacob Kaplan-Moss
On Nov 16, 2005, at 12:58 PM, David S. wrote: Jacob Kaplan-Moss jacobian.org> writes: would you be up for testing a (possibly buggy) backend if I could get one out? I would like to volunteer as well. Are there unit tests or is that part of volunteering? There are inteed unit tests

Re: When will there be a Oracle Backend?

2005-11-16 Thread Jacob Kaplan-Moss
On Nov 16, 2005, at 3:10 PM, Jeremy Dunck wrote: select x from foo limit 10 offset 20 becomes: select * from ( select x from foo ) where rownum between 20 and 30 Right; the issue is that query rewriting is... scary; making the backend rewrite your queries for you sucessfully could be diffi

Re: Preventing Google Web Accelerator from prefetching

2005-11-16 Thread Jacob Kaplan-Moss
On Nov 16, 2005, at 4:16 PM, Richie Hindle wrote: I've written a small piece of middleware to prevent Google Web Accelerator (or any other prefetching client) from prefetching URLs. Since this is my first piece of middleware, I'd appreciate it if those more experienced than me could tell me

Re: templates & content-elements

2005-11-17 Thread Jacob Kaplan-Moss
On Nov 17, 2005, at 10:21 AM, patrick kranzlmüller wrote: i´d like to do something similar to TemplaVoila (used within Typo3). i don´t like Typo3 at all, but their concept of "Futuristic Template Building" is really good, i think. if anyone has an idea of how to implement this functionality

Re: Django and Ruby on Rails framework roundtable: Dec. 3 in Chicago

2005-11-17 Thread Jacob Kaplan-Moss
On Nov 17, 2005, at 3:22 PM, Clint Ecker wrote: Will the event be recorded, either audio or video? I'm trying to get my hands on a DV cam to record video... If I can get one I'll certainly tape it. Jacob

Re: Django and Ruby on Rails framework roundtable: Dec. 3 in Chicago

2005-11-17 Thread Jacob Kaplan-Moss
On Nov 17, 2005, at 4:13 PM, Jacob Kaplan-Moss wrote: I'm trying to get my hands on a DV cam to record video... If I can get one I'll certainly tape it. There are times when working at a newspaper is a big bonus :) Turns out I can borrow at least one and possibly two DV cams, s

Re: Using umlauts

2005-11-17 Thread Jacob Kaplan-Moss
On Nov 17, 2005, at 4:43 PM, Steffen Glückselig wrote: Using an umlaut in a form-field of the admin-interface causes the validator to complain about 'only letters, numbers and underscores' being allowed. Is there a way to enable umlauts in form-fields? Sounds like you're using a SlugField or a

Re: 20 minute wiki, sortof.

2005-11-18 Thread Jacob Kaplan-Moss
On Nov 18, 2005, at 3:12 AM, David Ascher wrote: After watching the TurboGears 20 minute wiki screencast today, I figured I'd try to build the equivalent code in Django to see what it's like. Very cool -- I'm glad you had fun! Stumbling blocks: * figuring out that I had to do "import djang

Re: Tree structure

2005-11-20 Thread Jacob Kaplan-Moss
[moving this over to django-users, where it belongs] On Nov 20, 2005, at 8:43 PM, Ivan Fedorov wrote: I'm need to manage catalog of products in my site with multilevel structure. How can I'm create model, which can have parents of same type as model?.. something like that: class Category(m

Re: Sequence in PostgreSQL is not updated when doing manual insert

2005-11-23 Thread Jacob Kaplan-Moss
On Nov 23, 2005, at 11:15 AM, pgross wrote: I've tracked down the problem, and it seems that when I do my manual inserts, the sequence (cities_id_seq) that PostgreSQL uses for primary keys isn't updated. Therefore, when I try to save my object with django, the primary key collides with an alrea

Re: Django Trac Spam

2005-11-23 Thread Jacob Kaplan-Moss
On Nov 23, 2005, at 10:12 PM, Adrian Holovaty wrote: On 11/23/05, Tom Tobin <[EMAIL PROTECTED]> wrote: Someone's been spamming the Django Trac today, screwing up tickets and whatnot. Is there any way to fix and/or prevent this? I've been deleting 'em as they come in. Maybe we can hack Trac

Re: human readable name for a foreign key in admin

2005-12-02 Thread Jacob Kaplan-Moss
On Dec 2, 2005, at 1:33 PM, gags wrote: Great. I was wondering if I could somehow get the column header to be titled "Poll Type" instead of "Poll_type". Yup, just add the "verbose_name" option to Poll_type's META: class Poll_type(meta.Model): ... clas

Re: Contrib markup app not to be installed?

2005-12-03 Thread Jacob Kaplan-Moss
On Dec 3, 2005, at 5:13 AM, James Bennett wrote: While setting up a new project tonight, I was running through and doing a 'django-admin.py install' for each of the apps from django.contrib I'll be using, and when I got to the markup app, I got the following error: Error: No module named markup

Re: Django's MVC architecture

2005-12-05 Thread Jacob Kaplan-Moss
Hi Doug -- This is addressed in the FAQ: http://www.djangoproject.com/ documentation/faq/ Jacob

Re: Migrating existing data into Django models

2005-12-06 Thread Jacob Kaplan-Moss
On Dec 6, 2005, at 2:01 PM, tonemcd wrote: It seems though that Django uses ints for primary keys quite extensively, and I guess that will cause some problems with (say) creating new entries using the admin system. Does anyone have any pointers/hints/howtos etc on how to do this with a minim

[Job] Django developer position at World Online

2005-12-07 Thread Jacob Kaplan-Moss
Hey folks -- Want to get paid to write Django apps? You know you do... Well, we're hiring a Django developer, and I obviously want to hire someone out of the community if at all possible. Full details are at http://www.jacobian.org/2005/dec/07/job/; drop me an email if you're interested

Re: label for foreignkey-relations

2005-12-08 Thread Jacob Kaplan-Moss
Hey Patrick -- The "verbose_name" attribute is what you want:: class MyModel(meta.Model) country_1 = meta.ForeignKey(Country, verbose_name="Country One") country_2 = meta.ForeignKey(Country, verbose_name="Country Two") Jacob

Re: restructuredtext filter

2005-12-12 Thread Jacob Kaplan-Moss
On Dec 12, 2005, at 12:28 PM, [EMAIL PROTECTED] wrote: I had to copy django/contrib/markup/templatetags/markup.py to django/templatetags and the with the {% load markup %} line the filter works now. You don't have to do that either. Just put "django.contrib.markup" in your INSTALLED_APPS sett

Re: is Django too powerful?

2005-12-13 Thread Jacob Kaplan-Moss
On Dec 13, 2005, at 3:58 PM, Rock wrote: Wrong I think. There are already several Djangoids looking at making a discussion forum together as an open project. I expect there will be plenty of similar activities. Yes. The major thrust after 1.0 will be to build up a "standard Django library"

Re: Database Backup

2005-12-14 Thread Jacob Kaplan-Moss
On Dec 14, 2005, at 2:24 PM, Andreas Neumeier wrote: I was wondering, if it is possible to do a entire backup of the database into a, let's say XML file or something. The intention is to offer a easy possibility to users to install applications and roll back to previor states, like having a bac

Re: autonumbering within a date

2005-12-15 Thread Jacob Kaplan-Moss
On Dec 15, 2005, at 12:36 PM, coowwa coowwa wrote: I want to have a daily list of links that will be displayed by date. e.g. December 15, 2005 link 1 link 2 link 3 December 14, 2005 link 1 link 2 link 3 [snip] Does anyone have any suggestions about how to do this cleverly in Django? Any

Re: downloadable django documentation?

2005-12-20 Thread Jacob Kaplan-Moss
On Dec 20, 2005, at 4:15 PM, Jeffrey E. Forcier wrote: However, if I'm right in thinking the docs directory is up-to-date, that's probably a bit nicer on their bandwidth :) I probably shouldn't tell anyone... but our bandwidth is essentially free, so wget away :) I'm going to aim for a re

Re: downloadable django documentation?

2005-12-21 Thread Jacob Kaplan-Moss
On Dec 21, 2005, at 2:57 AM, Burhan wrote: For the impatient, you can disable CSS in your browser and get a nice 'print friendly' version. There's also a nice print stylesheet. Jacob

Re: Django for eCommerce?

2005-12-21 Thread Jacob Kaplan-Moss
On Dec 21, 2005, at 10:24 AM, Michael Hipp wrote: How suitable is Django for an eCommerce site (SSL, shopping cart, product database, accounts, etc.)? Very well suited. Jacob

Re: django design decision to use meta class

2005-12-29 Thread Jacob Kaplan-Moss
On Dec 27, 2005, at 2:17 PM, Dody Suria Wijaya wrote: One more thing that I have not seen is overrideable "prepare new row" method. triggered to provide customized field value, just after model instance creation. ie: This is addressed under "Added a more powerful way of overriding model m

Re: Search Functionality

2005-12-29 Thread Jacob Kaplan-Moss
On Dec 29, 2005, at 9:31 AM, Adrian Holovaty wrote: At World Online, the search engine (lawrence.com/search, ljworld.com/search) uses swish-e (http://swish-e.org/) to index files. [snip] Hope that helps! It would be pretty cool to open-source this mini search framework and pop it in django/c

Re: Django and Multiple Database Support

2005-12-29 Thread Jacob Kaplan-Moss
On Dec 29, 2005, at 9:10 AM, Adrian Holovaty wrote: ... or would you be doing more of a standard setup, in which you'd want database reads to be spread evenly across multiple DBs? Go ahead and explain the setup, and we can get started on designing the feature. I've always though that this part

Re: Search Functionality

2005-12-29 Thread Jacob Kaplan-Moss
On Dec 29, 2005, at 10:06 PM, Tom Tobin wrote: On 12/29/05, David Pratt <[EMAIL PROTECTED]> wrote: Doesn't Swish-e pose an incompatibility for licensing? Everything Django has been BSD up to this point and I would hate to see anything alter this. Isn't swish-e gpl? Swish-e grants a special

Re: A very simple application

2005-12-31 Thread Jacob Kaplan-Moss
On Dec 31, 2005, at 11:14 AM, Michael Hipp wrote: How do I make this work? In mysite/apps/simple/views.py I have: from django.core.extensions import render_to_response def saysomething(request): assert False, "Test assert" return render_to_response('base', {'message': "My message."

Re: Multiple apps on one page, how?

2005-12-31 Thread Jacob Kaplan-Moss
On Dec 31, 2005, at 11:02 AM, Michael Hipp wrote: How do I put multiple apps on one page/template? Just use both apps in the same view:: from django.models.polls import polls from django.models.blogs import entries def my_view(request): return render_t

Re: DB Field metadata

2006-01-03 Thread Jacob Kaplan-Moss
On Jan 3, 2006, at 8:52 AM, Dody Suria Wijaya wrote: Alice wrote: Is there a way of retrieving a database field's metadata? For example, the maxlength or choices parameters? It would be nice to automatically display the number of allowed characters for a given textfield. Hi Alice, try acc

Re: Accessing Post variables in _post_save

2006-01-03 Thread Jacob Kaplan-Moss
On Jan 3, 2006, at 9:45 AM, David Reynolds wrote: I'm sure there's a way, but I can't for the life of me work out how you could get access to POST variables in the _post_save functions. Can anyone help? You can't -- the save hooks are decoupled from the request processing framework (thin

Reminder: Django at PyCon 2006

2006-01-03 Thread Jacob Kaplan-Moss
Howdy -- A quick reminder: PyCon 2006 is coming up, and early-bird registration ($65 discount) is open until Jan 15th. There's a good bit of Django stuff planned, so if you can make it you should register! Here's what we've got going on: * Both Adrian and I will be giving a talk. Mine

Re: location in a server

2006-01-07 Thread Jacob Kaplan-Moss
On Jan 7, 2006, at 12:46 AM, Kenneth Gonsalves wrote: i have an installation of django on a server. The domain names given are or the form: http://myname.foo.com my django will live at http://myname.foo.com/mysite/ if i put this: then wouldnt requests to say http://yourname.foo.com/mysite/ al

Re: ANN: "Snakes and Rubies" (Django/Rails meetup) video/audio available

2006-01-08 Thread Jacob Kaplan-Moss
On Jan 8, 2006, at 12:58 AM, Eugene Lazutkin wrote: Just a suggestion: in addition to direct download and a torrent it should be uploaded to http://video.google.com. In this case it is easier to send a reference, when people ask. Not everybody can download the whole thing. I can do it for y

Re: Up and down in admin list

2006-01-09 Thread Jacob Kaplan-Moss
On Jan 9, 2006, at 8:43 AM, Rudolph wrote: I'm completely new to Django and started some experiments to see if it fits my needs. Do the object-lists in the admin interface have to possibility for up/down buttons, to move an object up and down in the list, by adjusting a sorting value in the data

Re: Templates for Python Programmers error

2006-01-11 Thread Jacob Kaplan-Moss
Hey Alice -- Thanks for the heads up; I've fixed the error in [1909]. Jacob

Re: permission without a model?

2006-01-11 Thread Jacob Kaplan-Moss
On Jan 11, 2006, at 12:37 PM, gabor wrote: i'd like to create a permission with is not related to any model object. is there a way to create such permission? INSERT INTO auth_permissions (name, package, codename) VALUES (); Jacob

Re: Duplicate object

2006-01-12 Thread Jacob Kaplan-Moss
On Jan 12, 2006, at 8:09 AM, Simon Willison wrote: Maybe it would be useful for all Django model objects to gain themselves a duplicate() method which does exactly this - returns an identical object but with id set to None. +1 -- obj.copy() might be a better syntax to mimic dict.copy(). Ja

Re: Bulk delete?

2006-01-13 Thread Jacob Kaplan-Moss
On Jan 13, 2006, at 1:12 PM, Ned Batchelder wrote: I'm used to writing SQL statements like: delete from app_things where type = 'foo'; to delete a number of objects at once. I don't see a way to do this type of delete in Django. I was hoping for something like: things.delete(type__exac

Re: Extending admin privileges

2006-01-23 Thread Jacob Kaplan-Moss
On Jan 23, 2006, at 11:53 AM, Andy Shaw wrote: Quick query: is there an easy way to limit staff users so that they can only alter records that belong to them? Specifically, so that only their own records show up in the admin interface. All the relevant models have an owner field that point

Re: Guido on Django

2006-01-27 Thread Jacob Kaplan-Moss
On Jan 27, 2006, at 9:53 AM, Wilson wrote: If I see another post on that thread that says "i'm very impressed with how fast turbogears is coming along! it should be actually useful in a few months now!" You'll what!? Don't leave me in suspense like that! Jacob

Re: ANN: "Snakes and Rubies" (Django/Rails meetup) video/audio available

2006-01-28 Thread Jacob Kaplan-Moss
On Jan 27, 2006, at 11:33 PM, Eugene Lazutkin wrote: After 18 days after uploading the main video file went live today: http://video.google.com/videoplay?docid=2939556954580527226. It includes the whole enchilada. Please somebody update "Snakes and Rubies downloads" page (http://www.djangop

[Job] Still looking for a Django developer

2006-02-02 Thread Jacob Kaplan-Moss
Hey folks -- We're still looking for a kick-ass Django developer to join our team here in Lawrence. You can read the full job info at http:// www.jacobian.org/2005/dec/07/job/, but here are some highlights: * You get to get paid to write Django apps, and even to hack on Django itself.

Re: SQL debugging

2006-02-02 Thread Jacob Kaplan-Moss
On Feb 2, 2006, at 1:48 PM, Luke Skibinski Holt wrote: Is is possible to access the SQL queries made as a template variable during any given page call? I've written a particularly ugly hack in order to use generic views and I'd like to see if it was all worth it ... Hey Luke -- This is in

Re: Tree View

2006-02-05 Thread Jacob Kaplan-Moss
On Feb 5, 2006, at 5:00 PM, Max Battcher wrote: It's still not semantic (uses presentation style instead of nested s). It's looking like if I really want a true list view I need to build a custom tag. Right now I think I'm just going to spread the tree out across the URL space. You migh

Re: custom admin view for edit_inline object

2006-02-09 Thread Jacob Kaplan-Moss
On Feb 9, 2006, at 12:21 PM, Robert Wittams wrote: PS Jacob is currently changing this code. So it might be that all this gets broken in the near future, as the plan seems to be to abandon non-AJAX edit inline AFAIK. Not quite the severely, actually -- I'm just changing the TABULAR/ STACKE

Re: memcached + multiple virtual hosts

2006-02-10 Thread Jacob Kaplan-Moss
On Feb 10, 2006, at 1:57 AM, Roberto Aguilar wrote: > I'm planning on running multiple websites on one server using virtual > hosts. I also want to run memcached and wanted to know what the best > way to avoid "name collisions". The best way to do it is to make sure that your keys have identifie

Re: more model basics - mny to many's

2006-02-14 Thread Jacob Kaplan-Moss
On Feb 14, 2006, at 9:55 AM, gizo wrote: Each Song can have Many Player/Instrument combinations (where each musician could play any instrument, in theory) Give this a shot:: class Musician(meta.Model): ... class Instrument(meta.Model): ...

Re: mod_python Segmentation fault importing django.utils.feedgenerator.py - with fix

2006-02-15 Thread Jacob Kaplan-Moss
On Feb 15, 2006, at 4:19 PM, Graham King wrote: > I have been getting a segmentation fault when using > django.utils.feedgenerator to generate an RSS feed of my site. This > works fine with 'django-admin runserver', but when run under > mod_python, 99% of the time this is because you're runni

Re: urllib2.open failing in Django?

2006-02-20 Thread Jacob Kaplan-Moss
On Feb 20, 2006, at 9:13 AM, Ned Batchelder wrote: > I have some code in a Django view that makes a request on another > server. It uses urllib2 to make an SSL connection to the server and > request a page. [snip] > When I run this in Django, I usually (but not always!) get an > exception: (re

Re: using the devel-webserver for production?

2006-02-20 Thread Jacob Kaplan-Moss
On Feb 20, 2006, at 3:28 PM, gabor wrote: > 1. except that it was not meant for that, are there any fundamental > problems with the "runserver"-webserver? Using runserver in production is like driving your car on a spare tire. It'll work, but when it blows up in your face someone's going to

Re: mod_python Error After mysqlhotcopy --help!!!

2006-02-25 Thread Jacob Kaplan-Moss
[EMAIL PROTECTED] wrote: > As for a I know, all I did was use mysqlhotcopy to backup some data and > now my whole site is down. > > Are there any issues with this? > > This site is supposed to go live in 24hrs. Wow, that sounds terrible -- I'm so sorry! There's nothing in Django that would cause

Re: Django scalability question

2006-02-28 Thread Jacob Kaplan-Moss
On Feb 28, 2006, at 7:49 AM, ZebZiggle wrote: > Sorry, but I don't think Django will work in anything but a single user > environment, or multi-users only doing read-only access. Unless someone > from the Django team can clarify. I'd be glad to: I have three web servers hitting the same database

Re: Django scalability question

2006-03-01 Thread Jacob Kaplan-Moss
Actually I'm about the check this in :) I've got a few things to fix before I do, but expect Django to have transaction support by noon. Jacob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gr

Re: Django scalability question

2006-03-01 Thread Jacob Kaplan-Moss
... And now it's done -- see http://code.djangoproject.com/browser/django/branches/magic-removal/docs/transactions.txt for the docs and http://code.djangoproject.com/changeset/2457 for the code. This should help a lot for high-volume writes, I suspect. Jacob --~--~-~--~~--

Re: How to change naming convention when creating models?

2006-03-24 Thread Jacob Kaplan-Moss
On Mar 24, 2006, at 1:33 PM, sam wrote: > Waht about the table names? I'd like to remove the 's' at the end of > each name. You want to "db_table" option; this is documented in the Model API doc at http://www.djangoproject.com/documentation/model_api/#meta- options Jacob --~--~-~--~-

Re: numeric formatting

2006-03-24 Thread Jacob Kaplan-Moss
On Mar 24, 2006, at 1:48 PM, Rock wrote: > Is there a template filter for turning a large integer into a human > readable number? > > 1234567 --> 1,234,567 > 12345 --> 12,345 > > I don't think that python built-in formatting can do this. (Am I > wrong?) Actually, locale.format will do it for yo

Re: Overthinking urls.py?

2006-03-28 Thread Jacob Kaplan-Moss
On Mar 28, 2006, at 8:55 AM, pbx wrote: > I think rolling functionality similar to ABSOLUTE_URL_OVERRIDES into > URLconfs is the way to go. As others have pointed out, > get_absolute_url() doesn't cover enough ground and creates unnecessary > coupling. > > Simon expresses it well here: > > http:

Re: logging

2006-03-30 Thread Jacob Kaplan-Moss
On Mar 29, 2006, at 8:03 PM, Brian Elliott wrote: > Is there a recommended way to do logging in a production > environment? Should I just use Python's logging module or is there a > built-in way to do this? (I am using the M-R branch.) Yeah, Python's logging module should do everything you need

Re: ContentType in magic removal :: how to?

2006-03-30 Thread Jacob Kaplan-Moss
On Mar 30, 2006, at 2:50 PM, arthur debert wrote: > sorry if this is too basic. ;-( , am I missing the obvious? > wouldn't a get_content_type() static method make sense for all model > classes? You want ContentType.objects.get_for_model(MyModel) Jacob --~--~-~--~~~--

Re: Set WOrking directory with mod_python

2006-03-30 Thread Jacob Kaplan-Moss
On Mar 30, 2006, at 3:45 PM, [EMAIL PROTECTED] wrote: > This is probably a really trivial question. > How do I set my Django app's current working directory when running > under mod_python? The "correct" answer is that you shouldn't be relying on the working directory in a web app; use absolute

Re: complex Q bug

2006-03-31 Thread Jacob Kaplan-Moss
On Mar 31, 2006, at 10:46 AM, Don Arbow wrote: > On Mar 31, 2006, at 8:05 AM, sam wrote: >> I was trying complex Q and notices if I do: >> >> complex=(Q1 | Q2) >> >> and >> >> complex = (Q1 or Q1) >> >> the results are not the same. I got right result using "or" but not >> with "|". Is this a bug

Re: Error in admin

2006-03-31 Thread Jacob Kaplan-Moss
On Mar 31, 2006, at 11:22 AM, Douglas Campos wrote: > How can I get rid of this error? > Could not import django.contrib.admin.views.main. Error was: cannot > import name isleap > > > Does anyone has a light to share? Most likely one of your models is importing a name that doesn't exist. What is

Re: How to exclude in limit_choices_to (magic removal)

2006-04-02 Thread Jacob Kaplan-Moss
Hey folks -- Magic-removal replaced the "__ne" and friends with the much-clearer "exclude()" lookup filter:: People.objects.exclude(firstname="Jacob") Is the same as trunk's:: people.get_list(name__ne="Jacob") Jacob --~--~-~--~~~---~--~~ You

Re: advice location of site for production and devel

2006-04-10 Thread Jacob Kaplan-Moss
On Apr 10, 2006, at 2:43 PM, [EMAIL PROTECTED] wrote: >> 2- First thing I need to know is this: If it is a project with some >> applications, the project should have a home page. From this home >> page, >> the user can choose from running applications. In the tutorial I've >> read nothing abou

Django users meetup in Palo Alto on April 27th

2006-04-13 Thread Jacob Kaplan-Moss
Howdy folks -- I'm organizing a Django users meetup in Palo Alto (CA) on April 27th. If you live in the area and want to meet up with other Djangonauts (over free food!), check out the details at http://www.jacobian.org/ 2006/apr/12/django-meetup-palo-alto/ and let me know to expect you the

<    1   2   3   4   5   6   >