Re: Django Cheat Sheet

2007-02-13 Thread Jacob Kaplan-Moss
On 2/13/07 4:24 AM, John Sutherland wrote: > My employer, Mercurytide [1], as some of you may have seen in the > past, publishes white-papers on a monthly basis. This month it's > another Django themed one: a Django cheat sheet: This is awesome, John -- many thanks for putting it together :) Jac

Reminder: Summer of Code application period closes May 8th

2006-05-05 Thread Jacob Kaplan-Moss
Howdy folks -- A quick note: the Summer of Code application period closes in only three days! We haven't received all that many applications yet, so if you turn in a good one you've got a very good chance that you'll be accepted. So what are you waiting for? Get those applications in! Ja

Re: Best practice for separating Model and Control?

2006-05-11 Thread Jacob Kaplan-Moss
On May 11, 2006, at 7:37 AM, Ned Batchelder wrote: > Django provides a great way to separate models and views, and even > pre-populates the project tree with directories named models and > views. > But what about separating models and controllers, that is, separating > the specific database repr

Re: Same app for each user

2006-05-13 Thread Jacob Kaplan-Moss
On May 12, 2006, at 8:13 PM, furtado wrote: > I can't figure out a way of using a simple blog app for each user > in my > project. Ideas? Oh, I've got lots of ideas... I'll bet if you take two mousetraps, and roll of duct tape, six strips of bacon... Oh you mean ideas about what *you* want t

Re: Context as Stack?

2006-05-13 Thread Jacob Kaplan-Moss
On May 13, 2006, at 4:30 PM, nevroe wrote: > The Django documentation here [1] says something about it being very > useful that Context objects are stacks. > > [1]: http://www.djangoproject.com/documentation/templates_python/ > > """ > A Context object is a stack. That is, you can push() and pop()

Re: Best practice for separating Model and Control?

2006-05-16 Thread Jacob Kaplan-Moss
On May 16, 2006, at 8:25 AM, Bill de hÓra wrote: > Which is to say in Java land we used to start with manager classes and > wish for generic DB APIs (like, we did that for *years*, until > Hibernate/Ibatis came along). I've never seen any interesting db- > backed > app not need to go round Manag

Re: Dreamhost - does anyone know a better webhosting?

2006-05-16 Thread Jacob Kaplan-Moss
On May 16, 2006, at 4:22 PM, Phil Powell wrote: > I have been hosted with these guys: http://www.bytemark.co.uk/ for > quite some time. I started out with them when they were a young > startup, and I can highly recommend them if you're looking for "full > control" solution. I can also highly rec

Re: Getting just the IDs?

2006-05-20 Thread Jacob Kaplan-Moss
On May 19, 2006, at 2:44 PM, [EMAIL PROTECTED] wrote: > I want to add a random picture component to an album app I'm building. > So I have a class Picture. I want to choose ten to twenty random > pictures out of all pictures submitted. > Obviously, I don't want to load all Picture instances (poten

Re: variable

2006-05-25 Thread Jacob Kaplan-Moss
On May 25, 2006, at 12:59 PM, Mary Adel wrote: > how could i get a variable from the database in the views > > for example i have a model like this: > class Menu (models.Model): > menu_text=models.TextField(maxlength=200) > > and i need to get this variable from the database under certain > co

Re: SQL Unions with QuerySets?

2006-05-26 Thread Jacob Kaplan-Moss
On May 26, 2006, at 10:34 AM, Doug Van Horn wrote: > Are there plans to provide & and | operators > on QuerySet objects? It seems like that'd be a pretty big > undertaking, > but pretty frickin sweet if done well /me steps out of time machine... See http://www.djangoproject.com/documentation/

JOB: Come work for World Online!

2006-05-26 Thread Jacob Kaplan-Moss
Howdy folks -- We're hiring a designer/developer/project manager here at World Online (where Django was first developed). If you want to work for the best web development team anywhere in the world, you need to drop us a line. My co-worker Jeff has (many) more details at http:// www2.jef

Re: Tagging app

2006-05-26 Thread Jacob Kaplan-Moss
Hey Luke -- Looks great; I've personally been working on something similar but it looks like you'll beat me to it :) I've also been slowing adding generic relationship support, and I'd really like to get a look at your GenericForeignKey class; chances are it would simplify a good deal of code I'

Re: London/UK Django developer wanted

2006-06-14 Thread Jacob Kaplan-Moss
On Jun 14, 2006, at 11:59 AM, Frankie Robertson wrote: > Just to let you know, > http://code.djangoproject.com/wiki/DevelopersForHire is the correct > place for posting this and scouting for available developers. Well... that's *a* correct place, but posting jobs to this list is perfectly OK.

Re: GenericForeignKey in admin

2006-06-22 Thread Jacob Kaplan-Moss
On Jun 22, 2006, at 10:24 AM, Jay Parlar wrote: > On 6/22/06, arthur debert <[EMAIL PROTECTED]> wrote: >> I've been playig with GenericForeignKey and they are great. > > I don't think any explicit work has been done yet to support the new > generic stuff in the Admin. There is in fact at least on

Re: Customizing form.x widgets - how?

2006-06-23 Thread Jacob Kaplan-Moss
On Jun 22, 2006, at 1:36 PM, [EMAIL PROTECTED] wrote: > The use-case and problem I have is when using a generic view and a > form; suppose my object being edited has a field called "description". > I'd like to just use {{form.description}} in the template, but the > default size (cols=, rows=) isn

Re: GenericForeignKey in admin

2006-06-23 Thread Jacob Kaplan-Moss
On Jun 22, 2006, at 2:00 PM, Jay Parlar wrote: > I noticed you just checked the patch in, thanks very much. I do have > the question though: Was the patch actually doing the overall right > thing? My patch modified the admin itself, instead of any of your > generic stuff. > > Maybe because of the

Re: Splitting the databases

2006-06-23 Thread Jacob Kaplan-Moss
On Jun 23, 2006, at 11:51 AM, sean wrote: > The only reason I wanted to split the db in the first place is that I > don't really like the thought of having the application data (like > auth, flatpages etc.) and the production database (which is also > accessed by other applications) in one db. I g

Re: Splitting the databases

2006-06-23 Thread Jacob Kaplan-Moss
On Jun 23, 2006, at 2:44 PM, patrickk wrote: > another reason for splitting databases: > we have several websites sharing the same userdata (so that users > only have to register once). with every app having about 300 tables, > one database may not be the right decision. > > any ideas on how to so

Re: Sniffing around django

2006-06-27 Thread Jacob Kaplan-Moss
On Jun 27, 2006, at 9:58 AM, toth anna wrote: > I'm working on my thesis in our academy (i have to > implement, too). > Searching for an enviroment, i found django, and it looks > very nice. > After reading tutorial, i have some questions (and more to > come...:) before i fall in love with it. > >

Django t-shirts: your ideas wanted!

2006-06-27 Thread Jacob Kaplan-Moss
Howdy folks -- I'm about to print up some Django shirts to take to OSCON next month -- got any ideas? We gotta move pretty fast (we're going to try to get an order in to the printer this week) so if you've got any hot ideas (or designs, for that matter) send 'em to me! I'll mail anyone wh

Re: How to select distinct rows?

2006-06-27 Thread Jacob Kaplan-Moss
On Jun 26, 2006, at 12:14 PM, Ville Säävuori wrote: > Say I have a model like > > class Example (models.Model): > ip = models.IPAddressField() > desc = models.CharField(maxlength=255) > created = models.DateTimeField(auto_now_add=True) > > How do I make a query that counts distin

Re: Django t-shirts: your ideas wanted!

2006-06-27 Thread Jacob Kaplan-Moss
On Jun 27, 2006, at 10:04 PM, Julio Nobrega wrote: > Django | Python: We indented jazz (some people say jazz' magic is > the space between the notes, a definition that I love) Ha -- that one makes me laugh... :) Jacob --~--~-~--~~~---~--~~ You received this mes

Re: SuspiciousOperation: User tampered with session cookie

2006-06-27 Thread Jacob Kaplan-Moss
Hi Patrick -- What happens when you clear out your sessions table? FYI, there's nothing about Ubuntu versus mod_python that would/could cause this (I use both). Jacob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Grou

Re: admin and GenericRelation field

2006-06-28 Thread Jacob Kaplan-Moss
On Jun 28, 2006, at 7:08 AM, Guillermo Fernandez Castellanos wrote: > I'm trying to modify my blogging application using the new > GenericRelation and GenericForeignKey, keeping the tagging concept as > easy as posible. > > The problem is, once the modifications made, I can not find a tag > field

Re: Limiting 'displayed' choices on a field (esp. in admin)

2006-06-30 Thread Jacob Kaplan-Moss
What you're looking for is the ``raw_id_admin`` option; fetching 11k rows from the database is going to be slow no matter how you cut it. ``raw_id_admin`` is documented at http://www.djangoproject.com/ documentation/model_api/#many-to-one-relationships. Jacob --~--~-~--~~

Re: PIL/Freetype2 Problem

2006-07-06 Thread Jacob Kaplan-Moss
On Jul 6, 2006, at 2:21 PM, Tyson Tate wrote: > PIL seems to have odd issues with MacOS X in its default state. I had > crazy problems trying to get PIL to read JPEGs. > > Here's some binary installers that handle PIL and other Python > libraries much more smoothly: > >

Re: where to put template tags post mr

2006-07-06 Thread Jacob Kaplan-Moss
On Jul 6, 2006, at 10:55 PM, Malcolm Tredinnick wrote: > It should work. You have some other problem going on. The standard > queries would be "is the app in INSTALLED_APPS?" and "do you have > templatetags/__init__.py?" Since I gather you are using code that > worked > previously, I guess these

Re: Django, I am almost ready to make the jump, here some doubts ?

2006-07-12 Thread Jacob Kaplan-Moss
Hey Ivan -- I'll do my best to answer your questions -- On Jul 12, 2006, at 10:49 AM, Iván Alemán wrote: > does anyone have integrated django with an actual development > environment, like the one I described above LAMP? I'm not sure what you mean by "actual development environment," but you

Re: Django, I am almost ready to make the jump, here some doubts ?

2006-07-12 Thread Jacob Kaplan-Moss
On Jul 12, 2006, at 4:11 PM, Iván Alemán wrote: > I mean that actually we're using LAMP environment plus other goodies > like Dojo, so the refined question (hopefully) is, can I integrate any > django project to my actual PHP/MySQL environment with minimum effort > so later (after publishing) we c

Re: recursive transaction support

2006-07-14 Thread Jacob Kaplan-Moss
On Jul 14, 2006, at 10:47 AM, Panard wrote: > So, is it only the sqlite backend wich doesn't support recursive > transactions, > or is django missing that point ? > If it's only a sqlite problem, is there a workaround? No databases that I'm aware of support nested transactions, thus Django do

Re: Django vs. Rails vs. Symfony: Django is fastest

2006-07-14 Thread Jacob Kaplan-Moss
On Jul 14, 2006, at 1:18 PM, Adrian Holovaty wrote: > Some folks benchmarked Symfony, Ruby on Rails and Django. Django was > the fastest. By over 30% -- hell yeah! Now, I've always known in my gut that Django's pretty damn fast, but seeing it verified by the RoR website... Priceless :) Jacob

Re: Django vs. Rails vs. Symfony: Django is fastest

2006-07-16 Thread Jacob Kaplan-Moss
On Jul 16, 2006, at 8:45 AM, [EMAIL PROTECTED] wrote: > I've done some httperf testing og the django server. I've used Arch > Linux (i686) on a Acer Aspire 5002 WLMi Laptop (AMD Turion 1,6GHz, > 512MB DDR RAM) from text mode (no X running) Interesting stuff -- thanks for the benchmarks. I'd note

Re: QuerySet

2006-07-17 Thread Jacob Kaplan-Moss
On Jul 18, 2006, at 12:04 AM, sasha wrote: > I must be missing something really obvious - QuerySets don't support > negative notation, so what is then the right way of getting at the > last > item in the set? Just order in the "other" direction. For example, to get the least expensive item in

Re: ContentTypes usage

2006-07-19 Thread Jacob Kaplan-Moss
On Jul 19, 2006, at 7:49 AM, Uros Trebec wrote: > Does anyone know how to use this thing? I do :) But you're really going to need to give me more information about what you're trying to do in order for me to help. Remember: specific questions get the best answers. Jacob --~--~-~--

Re: Django v code generators (codecharge)

2006-07-20 Thread Jacob Kaplan-Moss
On Jul 20, 2006, at 9:56 AM, Simon Willison wrote: > > On 20 Jul 2006, at 15:47, walterbyrd wrote: > >> If I were "up to speed" with python and django, could I develop as >> quickly as I could with a code generator? > > Yes. As a general rule, code generators are unnecessary if you are > using a

Re: Caching in Django admin

2006-07-20 Thread Jacob Kaplan-Moss
On Jul 20, 2006, at 4:45 AM, Phil Powell wrote: > It seems odd that this doesn't seem to have popped up as a common > issue, if it is indeed something related to site-wide caching - it's > definitely a bit of a show-stopper when it comes to having a client > using an admin interface which doesn't

Re: implementing a user login

2006-07-20 Thread Jacob Kaplan-Moss
On Jul 20, 2006, at 1:49 PM, Josh Trutwin wrote: > I was browsing through the docs and tutorials but I'm not sure what > is the best place to look for how to implement the login portion. > I imagine this would require some use of sessions. > > Any tips/pointers? The auth docs are probably the bes

Re: django-admin.py

2006-07-20 Thread Jacob Kaplan-Moss
On Jul 20, 2006, at 4:36 PM, [EMAIL PROTECTED] wrote: > Running 'django-admin.py startproject mysite' does nothing in new > installation > of o.95-py2.4 on WinXP. Anyone run into this before? Do you mean it prints nothing (it's supposed to succeed silently like good tools should) or it doesn't

Re: shared apps accross multiple sites/projects

2006-07-20 Thread Jacob Kaplan-Moss
On Jul 20, 2006, at 4:49 PM, Brian Hamman wrote: > I'd really appreciate suggestions or advice others have from solving > similar problems. What are some ways that others have organized > multiple apps/projects/sites? You're on the right track to think about putting the apps outside the project

Duct tape

2006-07-21 Thread Jacob Kaplan-Moss
On Jul 20, 2006, at 9:58 PM, Elver Loho wrote: > Speaking of duct-tape, though. The various "magic" bits of Django > seemed, to me at least, to be somewhat duct-tape-ish. Yeah, it was > certainly useful being able to just set a variable and have it do > something cool that you need, but it made me

Re: Is Django the framework I've been looking for?

2006-07-21 Thread Jacob Kaplan-Moss
On Jul 20, 2006, at 9:43 PM, Sean Schertell wrote: >> How about memory footprint? Can I run 100+ >> Django sites on a shared server and expect smooth sailing? Well, it certainly depends on the server, of course -- you obviously get what you pay for. The memory consumption for a single mod_pyth

Re: [OT] Is Django the framework I've been looking for?

2006-07-21 Thread Jacob Kaplan-Moss
On Jul 21, 2006, at 11:50 AM, Josh Trutwin wrote: > What's the digg link out of curiousity? http://digg.com/offbeat_news/Dog_eats_Nintendo..._DS_Lite%3B_Oh% 2C_and_NIntendo_s_Customer_Service_rocks. Wow, almost 1200 diggs now... schweet. Jacob --~--~-~--~~~---~--~-

Re: Djboss? Jyngo?

2006-07-21 Thread Jacob Kaplan-Moss
On Jul 21, 2006, at 1:57 PM, [EMAIL PROTECTED] wrote: > The JRuby project recently announced that their next release will > include the ability to run Ruby on Rails within J2EE application > servers like JBoss or WebSphere. Would there be any interest in > pursuing a similar project for Django +

Re: AttributeError: class Http404 has no attribute 'has_header'

2006-07-23 Thread Jacob Kaplan-Moss
On Jul 23, 2006, at 5:52 PM, Afternoon wrote: > Has anybody else seen this error? It's obvious that Http404 doesn't > have the method, it's just a subclass of Exception. If this is just a > Django bug, I'll happily post a patch, just want to feel out any > possible stupidness on my part first :-)

Re: AttributeError: class Http404 has no attribute 'has_header'

2006-07-24 Thread Jacob Kaplan-Moss
On Jul 24, 2006, at 6:03 AM, James Bennett wrote: > That'd probably be a good idea; I remember being somewhat befuddled > when I wrote up my "how Django processes a request" at not being able > to find anything that checked whether the return value from the view > (or middleware, if that's what en

Re: Errors in following tutorial

2006-07-25 Thread Jacob Kaplan-Moss
On Jul 25, 2006, at 7:49 PM, Joe wrote: > However, I have a question: Rock Howard had posted a workaround, > Jacob > then closed the ticket indicating "Transaction management (now on > magic-removal) provides a fix for this problem. Use it. Love it." but > not explicitly describing how the fix

Re: [Changeset] r3455 - django/trunk/docs

2006-07-28 Thread Jacob Kaplan-Moss
On Jul 28, 2006, at 11:54 AM, Jay Parlar wrote: > Not that I mind :) http://code.djangoproject.com/changeset/3477 Jacob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: using legacy db system

2006-08-01 Thread Jacob Kaplan-Moss
On Aug 1, 2006, at 9:16 AM, [EMAIL PROTECTED] wrote: > This might be of some help: > http://code.djangoproject.com/wiki/MultipleDatabaseSupport > > It's a SoC 2006 project, so the branch has yet to be merged into trunk > but he reports it as being feature-complete. It just might not be 100% > stab

Re: VMWare image for running/developing Django

2006-08-01 Thread Jacob Kaplan-Moss
On Aug 1, 2006, at 11:40 AM, Joseph Heck wrote: > I was fiddling with a VMWare image for running and developing > Django with > the intention of posted the results up for anyone to use, and I got > myself > tied all in knots. So let me ask the community: what would be the most > useful: > > 1)

Re: Problem with serializers

2006-08-04 Thread Jacob Kaplan-Moss
On Aug 4, 2006, at 12:05 PM, Seth Buntin wrote: > DeprecationWarning: Non-ASCII character '\xe2' in file > /Users/sethbuntin/django_projects/kate/tick/ajax_views.py on line 6, > but no encoding declared; see http://www.python.org/peps/pep-0263.html > for details > return getattr(__import__(mod_n

Re: Views, Filters, and Pain

2006-08-04 Thread Jacob Kaplan-Moss
On Aug 4, 2006, at 12:20 PM, Dave wrote: > Now, I know I'm probably not making proper use of the User object, so > any suggestions in that regard would be helpful, as well as tied to > the > main problem I'm having. Yeah, what you want is ``request.user`` -- that's the user who's loading the

Re: Off Topic: Mac software for database design?

2006-08-04 Thread Jacob Kaplan-Moss
On Aug 4, 2006, at 11:40 AM, Rob Hudson wrote: > I've seen some screencasts of various web frameworks (rails, > turbogears) where the user has a nice interface to a mysql admin tool > for creating tables, running queries, etc on a Mac. I can't find a > reference anywhere to what this might be. I

Re: Admin select multiple ?

2006-08-23 Thread Jacob Kaplan-Moss
On Aug 23, 2006, at 5:12 PM, [EMAIL PROTECTED] wrote: > Maybe I missed this in the docs but... Is there any way to specify a > model that uses choices so that the user can select multiple items? Hey Jay -- No, there's no way to do this with ``choices``. I'd suggest just using a ``ManyToManyFi

Re: Uses cases for dynamically changing MEDIA_URL

2006-08-23 Thread Jacob Kaplan-Moss
On Aug 23, 2006, at 11:16 AM, Rob Hudson wrote: > Are these two scenarios possible in Django? Of course :) Remember -- settings files are just Python code. This means you can include any type of logic in them that you like. I often write settings files that work a bit differently on differ

Re: Webdav access - OT

2006-08-23 Thread Jacob Kaplan-Moss
On Aug 23, 2006, at 5:26 AM, toth anna wrote: > I need to provide webdav access (upload) to my customer. > Problem is, uploaded files should hold not in filesystem, > but in database (which other "end" is in django). > Our diversified solutions are converges to python, so i'm > searching for pytho

Re: IN field lookup with empty list

2006-08-23 Thread Jacob Kaplan-Moss
On Aug 23, 2006, at 8:27 AM, Enrico wrote: > I realized that using the IN field lookup with an empty list, it > generates a SQL error (at least on MySQL). > [snip] > Any thoughts? I *thought* this was fixed in trunk; what version of Django are you running? If you are on trunk, posting the code

Re: upload files to another server

2006-08-23 Thread Jacob Kaplan-Moss
On Aug 23, 2006, at 8:13 AM, zenx wrote: > I was reading some django performance tips: > http://www.jacobian.org/writing/2005/dec/12/django-performance-tips/ > One of them is: "Use a separate media server" > But how could I upload files with Django FileField or ImageField to > another webserver th

Re: upload files to another server

2006-08-24 Thread Jacob Kaplan-Moss
On Aug 24, 2006, at 9:31 AM, Jay Parlar wrote: > And there won't be any docs on setting up NFS with Django. Your Django > won't know you're running NFS, and NFS won't know you're running > Django. They're unrelated to each other. Took the words right out of my mouth :) > There should be a ton of

Re: Extracting arguments to web service methods

2006-08-24 Thread Jacob Kaplan-Moss
On Aug 24, 2006, at 8:16 AM, magus wrote: > This is a little cumbersome though since I need to enclose it in a > try-catch block to deal with missing arguments. Note that ``request.GET`` and friends follow the standard Python mapping interface, so you can use ``get()`` to provide a default valu

Re: Extracting arguments to web service methods

2006-08-24 Thread Jacob Kaplan-Moss
Jacob Kaplan-Moss wrote: > Oh, and in the future, questions like these are better addressed to > django-users [...] Which is, of course, exactly where you posted this. Sheesh, I'm a moron. Time for more coffee. Jacob --~--~-~--~~~---~--~~ You re

Re: Emailing Error Messages

2006-08-24 Thread Jacob Kaplan-Moss
On Aug 24, 2006, at 10:31 AM, Martin Ostrovsky wrote: > Is there an existing method or means in Django to have any exceptions > that are caught emailed automatically? Or does this require a bit of > custom code? If ``DEBUG`` is ``False``, Django will email any errors to the people in the ``ADMI

Re: How to accep only uppercase characters without using manipulators/validators?

2006-08-28 Thread Jacob Kaplan-Moss
On Aug 28, 2006, at 8:52 PM, Vizcayno wrote: > Is there a way to solve my need without using manipulators/validators? No, actually, because validators are *exactly* what you want to use here :) The right way to do what you want is to add a validator that checks that your ``code`` field is up

Re: django/core/meta

2006-09-01 Thread Jacob Kaplan-Moss
Hi Brian -- Django's actually undergone some pretty sweeping changes since you last played with it. Probably the best place to start is by reading the 0.95 release notes (http://www.djangoproject.com/documentation/ 095_release_notes/) for an overview of what's changed. That page will event

Re: Djangoproject site broken ?

2006-09-01 Thread Jacob Kaplan-Moss
On Sep 1, 2006, at 6:18 AM, Bruno Desthuilliers wrote: > Seems like there are problems with the djangoproject site - no css, > broken internal links etc... (someone mentionned it on c.l.py a few > minutes ago, and I experimented the same problem). Fixed now, FYI. Jacob --~--~-~--~~-

Re: django/core/meta

2006-09-01 Thread Jacob Kaplan-Moss
On Sep 1, 2006, at 9:17 AM, brian corrigan wrote: > However with the project I'm working on, I can't change the Django > version I'm working on. I have tried doing an SVN update on the core > directory but meta was not included in it. Is there anyway I can > download the relevant files/folders? W

Re: Django patch!

2006-09-01 Thread Jacob Kaplan-Moss
On Sep 1, 2006, at 7:05 PM, Jan Claeys wrote: > The Akismet "spam protection" does more bad than good, that's going > on. > (Someone will ask you to submit your IP to be added to a whitelist > soon, > but that's just fighting the symptoms IMNSHO.) > > To the admins of the site: isn't it possib

Re: Anonymous Session?

2005-07-31 Thread Jacob Kaplan-Moss
On Jul 31, 2005, at 3:36 PM, Chuck Thier wrote: Since there has been no docs on sessions yet, I have been looking through the code to figure out how to use anonymous sessions. The only problem is that it looks like it sets the session object in the response to None if it is an anonymous user, a

Re: edit_inline

2005-08-02 Thread Jacob Kaplan-Moss
On Aug 2, 2005, at 12:17 PM, raffaele messuti wrote: class Label(meta.Model): fields = ( meta.CharField('name', 'name', maxlength=200, core=True), meta.URLField('url', 'url', blank=True, core=True), ) #admin = meta.Admin() def _

Re: meta.FileType

2005-08-03 Thread Jacob Kaplan-Moss
On Aug 3, 2005, at 11:04 AM, Andreas Kostyrka wrote: Could someone explain in more depth how to use a FileType? My admin interface shows a File Selection element, but no matter what I enter the record doesn't get saved. OTOH the admin interface doesn't show any error messages. http://w

Re: meta.FileType

2005-08-03 Thread Jacob Kaplan-Moss
On Aug 3, 2005, at 11:46 AM, yacc wrote: meta.FileField('data', upload_to="upload"), OK, that looks good. downman/settings/admin.py:ADMIN_MEDIA_PREFIX = '/media/' downman/settings/main.py:MEDIA_ROOT = '/tmp/' downman/settings/main.py:MEDIA_URL = '/media/' MEDIA_URL probably should

Re: meta.FileType

2005-08-03 Thread Jacob Kaplan-Moss
On Aug 3, 2005, at 12:59 PM, yacc wrote: admin.py is importing main :) Just checking; I've made that mistake more times than I can count. Well, it's running as my user (non-root) with runserver, and /tmp/upload is a directory that I've created before (and no, it didn't work before I've cre

Re: Downloading the djangoproject.com site code

2005-08-03 Thread Jacob Kaplan-Moss
On Aug 3, 2005, at 11:55 AM, stinger wrote: Good to see the djangoproject.com site code available for study and inspection. Is there a zipped file containing the code? I haven't seen it, so forgive if it's there. You'll need to check it out using SVN for the time being; use "svn checkout

Re: Planet Django

2005-08-04 Thread Jacob Kaplan-Moss
Hey guys -- I'm working on a "planet Django" thing for djangoproject.com (written in Django, naturally :). If you've got a blog (or know of one) that covers Django, please send me a link to the feed -- preferably a feed for the Django category, if it exists. I'll try to have something u

Re: Permission

2005-08-05 Thread Jacob Kaplan-Moss
On Aug 5, 2005, at 3:14 PM, A wrote: I am exploring Django for the first time, and I like what I see. Great work. Thanks! Looking at the security model, it is a RBAC ( Rol Based Access Control ). I have already a CBAC ( Context Base Access Control ) for a web application in another framework

Re: Recipie/tutorial for Django and no apache?

2005-08-07 Thread Jacob Kaplan-Moss
On Aug 7, 2005, at 1:30 PM, MrMuffin wrote: I am aware of the testing-only pure-python web-server. What excactly are the short-cummings of the test-server? Is it slow, unstable, not thread-safe? Yes, yes, and maybe -- the built-in server is based on python's built- in BaseHTTPServer, which

Re: Planet Django

2005-08-08 Thread Jacob Kaplan-Moss
On Aug 7, 2005, at 11:55 PM, Milton Waddams wrote: any chance of an rss feed? I added one this morning: http://www.djangoproject.com/rss/community/ Jacob

Re: One file per class in models?

2005-08-11 Thread Jacob Kaplan-Moss
On Aug 11, 2005, at 9:37 AM, ludo wrote: Is there a standard way to have multiple files (eg one per class) inside an app's model/ folder? Yes -- just put multiple files in the folder :) I seem to end up with a different app prefix for each file no matter what I try, eg mysite/apps/myapp/boxe

Re: One file per class in models?

2005-08-11 Thread Jacob Kaplan-Moss
On Aug 11, 2005, at 10:19 AM, ludo wrote: Jacob Kaplan-Moss wrote: That's by design (but you can change it if you like). If you've got "mysite.apps.myapp" in INSTALLED_APPS, and the files "boxes.py" with a Box model, you'll indeed get a model called "

Re: One file per class in models?

2005-08-11 Thread Jacob Kaplan-Moss
On Aug 11, 2005, at 10:54 AM, Ludovico Magnocavallo wrote: Jacob, I *did* have a look at the tutorials and the django site in svn, but all the examples I found had one model file per app. >>> That's by design (but you can change it if you like). If you've got >>> "mysite.apps.myapp" in IN

Re: One file per class in models?

2005-08-11 Thread Jacob Kaplan-Moss
On Aug 11, 2005, at 11:16 AM, Ludovico Magnocavallo wrote: Jacob Kaplan-Moss wrote: Ah, chances are that's because you didn't add the model file to the __all__ in myapp/models/__init__.py Nope, it's there... Hm... what's the output of "django-admin sql" look like? Jacob

Re: One file per class in models?

2005-08-11 Thread Jacob Kaplan-Moss
On Aug 11, 2005, at 3:25 PM, jhernandez wrote: One of the QOTW of Dr. Dobb's Python-URL! - weekly Python news and links (Jun 22) says: "It happens that old Java programmers make one module per class when they start using Python. That's more or less equivalent of never using more than 8.3 cha

Re: Do django app URLs always have a trailing slash?

2005-08-12 Thread Jacob Kaplan-Moss
On Aug 12, 2005, at 1:48 PM, Michael Josephson wrote: Do URLs within a django app always have a trailing '/'? e.g. If I enter a url such as http://localhost:8080/myapp/list it automatically redirects to http://localhost:8080/myapp/list/ and if I define a urlpattern such as (r'^list$', 'list_item

Re: Limiting database connections?

2005-08-12 Thread Jacob Kaplan-Moss
On Aug 12, 2005, at 3:10 PM, Ksenia Marasanova wrote: 2005/8/12, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: I ran out of database connections today. I'd like to prevent this in a way other than increasing my database connections. How does this work in Django? I'd like more reuse and all. Comi

Re: Limiting database connections?

2005-08-12 Thread Jacob Kaplan-Moss
On Aug 12, 2005, at 4:36 PM, Matthew Marshall wrote: From this quote on the sqlrelay site... """ An application coded using another database's native client API may be able to use SQL Relay without modification. SQL Relay provides drop-in replacement libraries for: * MySQL * PostgreSQL

Re: ForeignKey and the admin interface

2005-08-15 Thread Jacob Kaplan-Moss
On Aug 15, 2005, at 8:16 AM, Dagur wrote: Is it possible to somehow limit the size of drop-down lists in the admin interface when editing an item that has a ForeignKey relation to another table? I have a rather large database and when I want to edit an item in one of my tables, the page I get i

Re: What is this sites thing?

2005-08-18 Thread Jacob Kaplan-Moss
On Aug 18, 2005, at 8:48 AM, Milton Waddams wrote: --- view --- latest_stories_list = storys.get_list(order_by=['-pub_date'], limit=5, active__exact=1, sites__domain__exact=DOMAIN) Currently I'm hardcoding DOMAIN, though plan to pull it in from the http headers. The

Re: [newbie] Existing Database?

2005-08-18 Thread Jacob Kaplan-Moss
On Aug 18, 2005, at 10:32 AM, dharms wrote: This is a complete newbie question. I'm curious what experiences people had adopting Django to an already existing database (in use by other software and thus not easily changeable). Do you just have to create a model that matches the exisiting datab

Re: meta.Admin js option

2005-08-18 Thread Jacob Kaplan-Moss
On Aug 18, 2005, at 11:19 AM, David S. wrote: Since the admin templates are auto-generated, how does any JavaScript that you link in with the js option actually get used? The given JS URLs are added to the document's ; the can use onload events to modify the page display. For example, you

Re: On referencing ForeignKey fields in meta.Admin

2005-08-19 Thread Jacob Kaplan-Moss
On Aug 19, 2005, at 12:27 PM, Brantley wrote: Below is a model I created to track departments. When I give it "admin = meta.Admin()" I am then allowed to change my "supervisor", "manager", and "parent" fields. But if I define my own, how do I reference them? I tried something like:

Re: SQL operators from 'init'

2005-08-22 Thread Jacob Kaplan-Moss
On Aug 22, 2005, at 7:21 AM, Maniac wrote: But I thought that it would be very useful to have core SQL output from 'django-admin init', not only per-project SQL. It's actually very simple; all the "init" does is execute the following commands: django-admin sql core django-admin sql auth d

Re: Django applications licensing

2005-08-22 Thread Jacob Kaplan-Moss
On Aug 22, 2005, at 1:02 PM, [EMAIL PROTECTED] wrote: Not sure if someone can help me out here, but I have created an application using Django that I'd like to release under the GPL. I know that Django is released under a BSD license. Can anyone clarify for me whether I can release my applica

Re: CSS and PNG files in templates

2005-08-23 Thread Jacob Kaplan-Moss
On Aug 23, 2005, at 6:12 AM, Andy Shaw wrote: Or more simply put, the Django web server doesn't serve your media (e.g. images, PNG, CSS) and there isn't a plan to (the related ticket is marked as WONTFIX). Which majorly blows IMHO. It does seem somewhat contradictory to refuse to let the bu

Re: fun with imports

2005-08-23 Thread Jacob Kaplan-Moss
On Aug 23, 2005, at 6:28 AM, [EMAIL PROTECTED] wrote: I have a model that's making an xml-rpc call in _pre_save(). If I import ServerProxy at the top of the model file: from xmlrpclib import ServerProxy when _pre_save() is called it doesn't know what ServerProxy is. See "Using module global

Re: Multiple Sites under One Database

2005-09-07 Thread Jacob Kaplan-Moss
On Sep 7, 2005, at 12:40 PM, [EMAIL PROTECTED] wrote: Ok, and this means everything will be completely shared. Will the "site" part of the flatfiles function as I would guess? Exactly. Add a site object (has to be done manually in the DB right now) and then set the site for the flat page.

Re: Sorted list of objects

2005-09-08 Thread Jacob Kaplan-Moss
On Sep 8, 2005, at 8:56 AM, Achim Domma wrote: I'm just started to play with Django and it looks very promissing to me. For a small test app I would like to store sorted lists of items. In pure (Pseudo-)SQL I would do it like this: create table itemlists ( int unique_id, int name,

Re: memcached question

2005-09-09 Thread Jacob Kaplan-Moss
On Sep 9, 2005, at 12:08 PM, Eugene Lazutkin wrote: django.core.cache defines two cache classes: _MemcachedCache and _SimpleCache. If I understood correctly, _MemcachedCache.get() returns a string value, while _SimpleCache.get() returns an HttpResponse object. Is it a correct statement? N

Re: Validator for overlapping time intervals?

2005-09-12 Thread Jacob Kaplan-Moss
On Sep 12, 2005, at 6:37 AM, Sokolov Yura wrote: I have following (repeating) table structure: value=meta.TextField() (for example) time_from=meta.DateTimeField() time_to=meta.DateTimeField() How can I make a validator (called at object change or addition by generic views) to check t

Re: Validator for overlapping time intervals?

2005-09-12 Thread Jacob Kaplan-Moss
On Sep 12, 2005, at 9:32 AM, Sokolov Yura wrote: YES. When you use only object_list and object_detail generics there no problems. But it does not conform DRY principe. Huh? The entire point of generics is DRY... I'm not sure I follow. I wish to use create_object, update_object and delete_ob

Re: Validator for overlapping time intervals?

2005-09-12 Thread Jacob Kaplan-Moss
On Sep 12, 2005, at 11:15 AM, Sokolov Yura wrote: Ok I see. _manipulator_validate_ is some valid place (is this right?) How can I get a module from self? Just give me this method and I will be happy :-) (I am too lazy to search it at the moment :-) Well, I'm too busy to spell it all out for yo

Re: FileUploadField in an AddManipulator

2005-09-12 Thread Jacob Kaplan-Moss
On Sep 12, 2005, at 3:55 PM, Brant Harris wrote: Finally I hacked the render of FileUploadField to add enctype="multipart/form-data" to the INPUT field, but still nothing... The enctype business needs to be on the tag. Jacob

<    1   2   3   4   5   6   >