Re: What happened to django-updates?

2008-04-14 Thread James Bennett
On Mon, Apr 14, 2008 at 10:43 AM, John-Scott <[EMAIL PROTECTED]> wrote: > There hasn't been any updates on the django-updates mailing list since > March 18. At the time, someone on IRC said they thought it was due to > the traffic from the sprint but that was a month ago. I am tracking >

Re: Application Concepts

2008-04-14 Thread James Bennett
On Mon, Apr 14, 2008 at 6:03 AM, Waldemar Kornewald <[EMAIL PROTECTED]> wrote: > I agree that you can't always reuse those media files, but why does > that mean there shouldn't be an easy (automatic) way to serve media > files? Because Django should have nothing whatsoever to do with your

Re: How to extend django.views.generic.date_based to return more "context variables"?

2008-04-14 Thread James Bennett
On Mon, Apr 14, 2008 at 4:41 AM, fizban <[EMAIL PROTECTED]> wrote: > In fact by default it only returns "object" (or the > template_object_name name you pass), but I need it to return "year", > "month" and "day" too. This is because in my *_detail.html template > I'd have to keep on

Re: Application Concepts

2008-04-14 Thread James Bennett
On Thu, Apr 10, 2008 at 2:49 AM, jurian <[EMAIL PROTECTED]> wrote: > Does anyone else think I should add a ticket request for this as a > future feature? I'm ambivalent, but leaning toward "no". In my experience, it's very rare to have media files that are truly coupled to a single specific

Re: Application Concepts

2008-04-14 Thread James Bennett
On Fri, Apr 11, 2008 at 1:09 PM, andy baxter <[EMAIL PROTECTED]> wrote: > What /should/ be inside the project folder? I often get severely flamed for saying this, but: I very rarely have a "project folder". All it is is a place to stick a settings file and a root URLConf module, both of which

Re: How to use dojo toolkit in django?

2008-04-14 Thread James Bennett
On Mon, Apr 14, 2008 at 2:13 AM, Duke <[EMAIL PROTECTED]> wrote: > Where to store the dojo toolkit in the project The same place you put all other CSS stylesheets, JavaScript, images and other static files. Similarly, they will be served the same way. There is specific documentation on how to

Re: alternative to (r'^house/edit/(\d+)/$',ediHouse)?

2008-04-12 Thread James Bennett
On Fri, Apr 11, 2008 at 6:28 PM, ydjango <[EMAIL PROTECTED]> wrote: > currently I am using constructing url as /house/edit/123/ > where 123 is house data base primary key for that house. > > Can exposing the primary key in url be any security issue? > > (r'^house/edit/(\d+)/$',editHouse) > >

Re: Allowing html tags for filter.

2008-04-11 Thread James Bennett
On Fri, Apr 11, 2008 at 11:35 AM, Dmitriy Sodrianov <[EMAIL PROTECTED]> wrote: > I have a custom filter that outputs some html code. The problem is > that it converts all "greater than" and "less than" symbols to > appropriate and symbols. How is it possible to say to > filter not to do

Re: how do I create a zebra table using a template?

2008-04-11 Thread James Bennett
On Fri, Apr 11, 2008 at 11:10 AM, Chas. Owens <[EMAIL PROTECTED]> wrote: > Alright, call me a moron, but this isn't working. What am I doing wrong? You got bad advice. You want to read the docs on the "cycle" tag, because this specific sort of thing is what it exists for. -- "Bureaucrat

Re: tutorial question

2008-04-11 Thread James Bennett
On Fri, Apr 11, 2008 at 5:20 AM, sebey <[EMAIL PROTECTED]> wrote: > i am on a mac and I am running a podcasting network so I will proabley > be storing all my files in XML/RSS I think you're suffering from very severe conceptual confusion. Take a podcast and think about it logically: Each

Re: Tree from the model.

2008-04-11 Thread James Bennett
2008/4/11 Dmitriy Sodrianov <[EMAIL PROTECTED]>: > Is it possible to use only Django's built-in functions? Yes, but you will end up essentially re-implementing all the code in the application Alex suggested. When an application exists that helps you to do what you want, it's quite silly to go

Re: Has anyone made an MS excel exporter in a django site yet?

2008-04-09 Thread James Bennett
On Wed, Apr 9, 2008 at 5:43 PM, Roboto <[EMAIL PROTECTED]> wrote: > I'm curious =P A couple of my users are requesting that I find a way > to export some data to excel so that they can manipulate as fit. It's easy enough to dump to CSV using the Python standard library, and Excel reads that

Re: Using ModelForm...not populating my choices

2008-04-09 Thread James Bennett
On Wed, Apr 9, 2008 at 4:21 PM, ydjango <[EMAIL PROTECTED]> wrote: > owner = models.ForeignKey(Participant,null=True) Not the *model* fields, the *form* fields for representing this type of relationship. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct."

Re: Using ModelForm...not populating my choices

2008-04-09 Thread James Bennett
On Wed, Apr 9, 2008 at 3:30 PM, ydjango <[EMAIL PROTECTED]> wrote: > Miles and Owner are defined as foreign_key to respective tables. Yes, but did you actually look at the docs for the field types that make it easy to represent foreign keys? -- "Bureaucrat Conrad, you are technically correct

Re: Using ModelForm...not populating my choices

2008-04-09 Thread James Bennett
On Wed, Apr 9, 2008 at 2:56 PM, ydjango <[EMAIL PROTECTED]> wrote: > Not for model form, if a ChoiceField is based on foreign Key. It is > getting values from the referenced table using the __unicode__ method > in that table and ignoring the choices field passed to it. Not in this case; the

Re: Google App Engine & Django

2008-04-08 Thread James Bennett
On Tue, Apr 8, 2008 at 12:36 PM, ydjango <[EMAIL PROTECTED]> wrote: > It pretty much excludes data driven and data intensive applications > where data consistency and reliability is very critical (ACID > properties). Yeah, Google certainly use their platform to do any data-driven or

Re: Anybody successfully deployed Django to appengine? Having some problems

2008-04-08 Thread James Bennett
On Tue, Apr 8, 2008 at 4:18 AM, Mat <[EMAIL PROTECTED]> wrote: > From what I've read django seems limited on appengine, no models, I'm > assuming this is because the ORM still needs porting, is anyone going to > look at this, or is the plan to just go with google models? Any thoughts, or > am

Re: Application Concepts

2008-04-08 Thread James Bennett
On Tue, Apr 8, 2008 at 1:38 AM, jurian <[EMAIL PROTECTED]> wrote: > Are django applications meant to be implemented in such a manner as to > allow the entire application directory to be copied into another > project and used without having to alter any of the code? Though I often get flamed

Re: sql & cache problem? Am I crazy?

2008-04-03 Thread James Bennett
On Thu, Apr 3, 2008 at 12:57 PM, Alessandro Dentella <[EMAIL PROTECTED]> wrote: > more. I'd like to understand why one of the 2 query used the cache and the > other didn't. Nothing in Django will magically cache things when you haven't told Django to cache things. Nothing in PostgreSQL will

Re: sql & cache problem? Am I crazy?

2008-04-03 Thread James Bennett
On Thu, Apr 3, 2008 at 11:04 AM, sandro dentella <[EMAIL PROTECTED]> wrote: > Any light to understand/solve it? > Thanks in advance Are you using MySQL? Its (server-side, not part of Django, but rather part of the MySQL database server itself) query cache is known to cause these sorts of

Re: Auth System

2008-04-01 Thread James Bennett
On Tue, Apr 1, 2008 at 3:38 PM, Mat <[EMAIL PROTECTED]> wrote: > I'm looking at django for a new project, and have a quick question, I'm > going to need a mixture of the Query-set branch and generic-auth branch, I > really need object based permissions, but it seems like generic-auth was >

Re: mark_safe for a html field

2008-03-31 Thread James Bennett
On Mon, Mar 31, 2008 at 6:46 AM, James Bennett <[EMAIL PROTECTED]> wrote: > Since subclassing Field to create your own custom model fields is easy > and documented, why not write an "HTMLField" class which calls > mark_safe() before returning a value? And though I m

Re: mark_safe for a html field

2008-03-31 Thread James Bennett
On Mon, Mar 31, 2008 at 6:40 AM, Marc Garcia <[EMAIL PROTECTED]> wrote: > I was thinking in giving a option on field definition, to make it safe > on all templates at same time. Anyway using safe filter as you > proposed is clearer than my initial solution. Since subclassing Field to create

Re: Custom ID field with random string

2008-03-31 Thread James Bennett
On Mon, Mar 31, 2008 at 4:00 AM, Julien <[EMAIL PROTECTED]> wrote: > I just thought I'd try to make it clearer what I'm after. Instead of > having numbers as ID for my objects, I'd like to have random strings > (e.g. "sadfwetbtyvt32452" or "fd70982876adhfd"...). Those strings have > to be

Re: Model Inheritance

2008-03-31 Thread James Bennett
On Mon, Mar 31, 2008 at 1:01 AM, jurian <[EMAIL PROTECTED]> wrote: > It's working on the latest development release. No, it's working in a branch. > Does that mean I > should move this discussion to the developers group? No, it means that if you're interested you should check out the branch,

Re: Permissions get automatically created without class Admin in models

2008-03-30 Thread James Bennett
On Sun, Mar 30, 2008 at 10:47 AM, Karen Tracey <[EMAIL PROTECTED]> wrote: > Note ticket #5926 has been hanging around for a few months on this issue, > with at least 3 people (one who provided a patch) hoping the fix would be to > change the code to match the docs versus changing the docs to

Re: Permissions get automatically created without class Admin in models

2008-03-30 Thread James Bennett
On Sun, Mar 30, 2008 at 8:06 AM, Carl <[EMAIL PROTECTED]> wrote: > The only problem is, that those automatically created permissions have > english descriptions and I'm building something for a german-only > speaking user base. But i think i'll just change the descriptions > manually in the

Re: Permissions get automatically created without class Admin in models

2008-03-30 Thread James Bennett
On Sun, Mar 30, 2008 at 8:06 AM, Carl <[EMAIL PROTECTED]> wrote: > I will open a ticket right away... Fixed in changeset 7388. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ You received this message

Re: Is Django thread safe?

2008-03-29 Thread James Bennett
On Sat, Mar 29, 2008 at 3:52 AM, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > The best I have ever been able to get out of anyone associated with > Django development about thread safety is the comments by Jacob Kaplan- > Moss in the following thread: And that's really about the best anyone

Re: scraping PDF

2008-03-28 Thread James Bennett
On Fri, Mar 28, 2008 at 11:21 PM, <[EMAIL PROTECTED]> wrote: > I'm trying to figure out the best way to link-up everything. Any > suggestions? So, since I talked about it at PyCon, I'll take an example from this project: http://www2.ljworld.com/data/crime/ku/ And I'll walk through this in a

Re: scraping PDF

2008-03-28 Thread James Bennett
On Fri, Mar 28, 2008 at 10:15 PM, <[EMAIL PROTECTED]> wrote: > our state legislature has all their reports online in PDF format, i > was hoping to scrape 'em and get them and use them with django to > create something similar to what adrian did with the w-p and others > have done. There are

Re: Purpose of Complex Generic Views

2008-03-28 Thread James Bennett
On Fri, Mar 28, 2008 at 6:40 PM, bob <[EMAIL PROTECTED]> wrote: > in some examples that require extra work, we have to define a wrapper > function. What's confusing me is how is this different from just > defining regular views? I can't quite notice much reduction in code, > nor

Re: User profile metadata problem

2008-03-28 Thread James Bennett
On Mar 28, 1:57 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > ordering = ['auth_user.first_name','auth_user.last_name'] Giving a model a default ordering based on a foreign key is not currently possible in either 0.96 or trunk. -- "Bureaucrat Conrad, you are technically correct -- the best

Re: IntegrityError: duplicate key violates unique constraint

2008-03-28 Thread James Bennett
On Fri, Mar 28, 2008 at 2:35 PM, makebelieve <[EMAIL PROTECTED]> wrote: > I haven't added any unique contraints. It really seems as though > django doesn't know > about my existing data. If I obliterate the old data everything works > fine, but > that's not a possibility. At the database

Re: IntegrityError: duplicate key violates unique constraint

2008-03-28 Thread James Bennett
On Fri, Mar 28, 2008 at 2:10 PM, makebelieve <[EMAIL PROTECTED]> wrote: > Saving some of my objects work, but only because early IDs have been > removed > so it isn't trying to insert an object with an existing ID. It sounds like you have a unique constraint in the DB that you haven't told

Re: math in django

2008-03-27 Thread James Bennett
On Thu, Mar 27, 2008 at 9:19 PM, Dan Ellis <[EMAIL PROTECTED]> wrote: > It's not possible to use aggregate functions in any Django release, > but IIRC it is something that has been added in the queryset-refactor > branch. Be careful how you say that: you're free to write any piece of SQL you

Re: Could not parse the remainder in Template?

2008-03-27 Thread James Bennett
On Thu, Mar 27, 2008 at 1:12 AM, django <[EMAIL PROTECTED]> wrote: > How do i convert {{ candidate.vote_set.filter(vote='TU').count()}} in > my view_candidate to work it properly > Right now it give me templatesyntax error Quoting the "Philosophy" section at the top of this page:

Re: Is identity map planned for Django ORM?

2008-03-27 Thread James Bennett
There's been active discussion recently on the developers list, which is generally the place to look for information about Django development... -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ You received

Re: Using a Read-Only model for data, second database for "django stuff"

2008-03-26 Thread James Bennett
On Wed, Mar 26, 2008 at 11:26 AM, James Bennett <[EMAIL PROTECTED]> wrote: > To transfer data to another DB, simply import the appropriate database > adapter and grab a cursor, then starting INSERT'ing or UPDATE'ing > away. (or, if you *must* use the ORM, use the seriali

Re: Using a Read-Only model for data, second database for "django stuff"

2008-03-26 Thread James Bennett
On Wed, Mar 26, 2008 at 8:08 AM, Jesse Noller <[EMAIL PROTECTED]> wrote: > I've been handed the task of doing a bit of data-mining on a bugzilla > database, and rather than work through the straight SQL, or using the > somewhat awful bugzilla query interface, I would much rather build out >

Re: Using mod in if in template

2008-03-24 Thread James Bennett
On Mon, Mar 24, 2008 at 2:12 PM, Tim Sawyer <[EMAIL PROTECTED]> wrote: > Unfortunately, I can't do the mod (%) in the if statement, as it's not valid > syntax. Is there a way around this, or a simpler solution? The first thing to do is to step back and remember that the Django template

Re: Add a new line in TextField

2008-03-09 Thread James Bennett
On Sun, Mar 9, 2008 at 8:06 AM, Daniel de la Cuesta <[EMAIL PROTECTED]> wrote: > How can I insert a return carriage and new line in a "TextField"? Yes, by pressing the "Enter" or "Return" key, as appropriate for your keyboard layout, or by copy/pasting some line breaks from elsewhere. Here are

Re: App not showing up in Admin Site

2008-03-09 Thread James Bennett
On Sun, Mar 9, 2008 at 7:46 AM, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > then use the docs for .96 - but it is far better to use the svn trunk > as there are a lot of goodies there that .96 doesnt have. Also when > you do upgrade you will face a lot of backward compatible problems

Re: Multiple apps on one template

2008-03-08 Thread James Bennett
On Sat, Mar 8, 2008 at 2:52 PM, DuncanM <[EMAIL PROTECTED]> wrote: > And I have a home page that I would like to display a "widget" (5 most > relevant of each) on that home page... > In the current situation I have created the view in the Events > application. How would I create a view

Re: Documentation Project [No django directly related]

2008-03-05 Thread James Bennett
On Wed, Mar 5, 2008 at 3:52 PM, Grupo Django <[EMAIL PROTECTED]> wrote: > These anotations are not 100% real, I've been looking only for a few > hours documentation about them, I don't know all the features of each > system yet. reST has two advantages: 1. Django already supports it for

Re: Permissions and login

2008-03-05 Thread James Bennett
On Wed, Mar 5, 2008 at 2:53 PM, Monica Leko <[EMAIL PROTECTED]> wrote: > Why first condition? Why checking is user authenticated? Doesn't the > request.user.has_permit("polls.can_vote) already imply that user is > authenticated? Can anonymous users have permissions? If they can, > and if

Re: Upgrade to development version - Admin no longer works

2008-03-03 Thread James Bennett
On Mon, Mar 3, 2008 at 10:29 AM, merric <[EMAIL PROTECTED]> wrote: > There is no VIEW called "help_no_cookies" in the promotions.views > module. Should there be? You apparently have an old URL pattern somewhere in your project which tries to reference such a view; previously this was not an

Re: has "newforms-admin" branch been integrated?

2008-03-02 Thread James Bennett
On Mon, Mar 3, 2008 at 1:48 AM, Niklas Collin <[EMAIL PROTECTED]> wrote: > I was wondering if (and I quote the manual chapter 17 ;) the > "newforms-admin"-branch has been integrated yet? Have you considered looking for an announcement regarding that, or perhaps looking at the timeline for a

Re: revert database migration

2008-03-02 Thread James Bennett
On Sun, Mar 2, 2008 at 11:45 PM, stranger <[EMAIL PROTECTED]> wrote: > Is there a way in django where we can migrate the changes in model, > or revert back database changes to the original(fresh). You probably want to search the archive of this list, which is publicly available and powered by

Re: django model concurrency?

2008-03-01 Thread James Bennett
On Fri, Feb 29, 2008 at 5:02 PM, kbs <[EMAIL PROTECTED]> wrote: > Is anybody aware of any documentation related to how django ORM > handles concurrency? I am assuming that it is delegated to the > database. Anyway, I did a test using a threaded client to call a view > and increment a shared

Re: Unexpected newforms/sites behavior

2008-02-25 Thread James Bennett
On Mon, Feb 25, 2008 at 11:55 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Correction... ModelChoiceField works as expected. It's when I try to > set it as a multi-select that I get the sql error: For multi-select, use ModelMultipleChoiceField. -- "Bureaucrat Conrad, you are

Re: Unexpected newforms/sites behavior

2008-02-25 Thread James Bennett
On Mon, Feb 25, 2008 at 10:14 AM, Doug B <[EMAIL PROTECTED]> wrote: > Assign your choices to the ChoiceField. The Field class is what does > the validation, not the widget. By passing them into just the widget > they are displaying, but not in the Fields 'approved' list. No, he really

Re: Unexpected newforms/sites behavior

2008-02-25 Thread James Bennett
On Mon, Feb 25, 2008 at 9:10 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Which - as expected - creates a multi-select box with the appropriate > cars. Problem is, when the user selects one the form validation kicks > it out, saying it is not a valid choice. If I don't use the custom >

Re: single-field, single-instance models

2008-02-25 Thread James Bennett
On Mon, Feb 25, 2008 at 10:06 AM, Daniel Roseman <[EMAIL PROTECTED]> wrote: > Sounds like a job for dbsettings: > http://code.google.com/p/django-values/ Or flatpages. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct."

Re: scaffold with Django

2008-02-25 Thread James Bennett
On Mon, Feb 25, 2008 at 6:24 AM, bcurtu <[EMAIL PROTECTED]> wrote: > Is there any kind of utility for automatic scaffolding? By preference, Django development does not involve generation of static files of code on disk; instead, functionality like "show a form to create an object", "show a list

Re: newforms pre-populating with model

2008-02-24 Thread James Bennett
On Sun, Feb 24, 2008 at 11:02 PM, k4ml <[EMAIL PROTECTED]> wrote: > Get the instance:- > customer = Customer.objects.get(id=1) > > Create form instance and pass a dict of data from customer instance:- > form = CustomerForm(initial=customer.__dict__) #instance of ModelForm If you have a look

Re: Django minify and combine script?

2008-02-23 Thread James Bennett
On Sat, Feb 23, 2008 at 8:26 AM, Thierry <[EMAIL PROTECTED]> wrote: > I've recently made the switch from Symfony to Django. > Some interesting code here :) > When searching around I can't seem to find any javascript and css > minifier and combiner. > Can anyone recommend a good one? Just a

Re: managers vs static/class methods ?

2008-02-21 Thread James Bennett
On Thu, Feb 21, 2008 at 9:35 AM, glopglop <[EMAIL PROTECTED]> wrote: > Not trying to be slow-witted, but couldn't you do > > objects = MyModel.unfiltered() if request.user.is_admin else > MyModel.filtered() > (where objects is a queryset) > > is there a functionnal difference or is it more

Re: Authentication not applied in base template

2008-02-20 Thread James Bennett
On Wed, Feb 20, 2008 at 5:18 PM, quizkiwi <[EMAIL PROTECTED]> wrote: > Is there some difference in authentication between the app and the > main site? http://www.djangoproject.com/documentation/templates_python/#subclassing-context-requestcontext -- "Bureaucrat Conrad, you are technically

Re: One CSS, One JS in production mode for django?

2008-02-18 Thread James Bennett
On Feb 18, 2008 3:21 PM, mamcxyz <[EMAIL PROTECTED]> wrote: > I wonder if exist a similar toolset as in ruby: Believe it or not, this question has been asked before on this very list; try searching the archive for suggestions. -- "Bureaucrat Conrad, you are technically correct -- the best

Re: Whitespace handling in newforms modelforms

2008-02-18 Thread James Bennett
On Feb 18, 2008 2:37 PM, web-junkie <[EMAIL PROTECTED]> wrote: > why isn't whitespace automatically stripped from fields when using > modelforms? This would be convenient. Up until the moment you need to store some source code written in the language Django uses. -- "Bureaucrat Conrad, you

Re: ImportError: No module named base

2008-02-18 Thread James Bennett
Most likely, you all have out-of-date versions of the MySQLDb adapter (the Python module which lets Python talk to a MySQL database). -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ You received this

Re: Django scope

2008-02-16 Thread James Bennett
On Feb 17, 2008 12:02 AM, Jean-Christophe Kermagoret <[EMAIL PROTECTED]> wrote: > Hello, I'm coming from Java world and I'm looking in Django for a high > level framework to write very quickly new applications. > Does Django provide the following features ?

Re: A "philosophical" question

2008-02-15 Thread James Bennett
On Fri, Feb 15, 2008 at 6:15 AM, dreamingbear <[EMAIL PROTECTED]> wrote: > I understand. I had the tag idea too, but still it seems to me that > this is putting business logic in the V of MVC - don't get me wrong, I > said that Django has a beautiful architecture. This is just pondering. See

Re: How to use autoescape?

2008-02-14 Thread James Bennett
On Thu, Feb 14, 2008 at 3:01 PM, Ting Zhou <[EMAIL PROTECTED]> wrote: > Could somebody tell me how to use autoescape in django? http://www.djangoproject.com/documentation/templates/#automatic-html-escaping -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct."

Re: Xcode as Django IDE

2008-02-13 Thread James Bennett
On Feb 13, 2008 3:57 PM, zombat <[EMAIL PROTECTED]> wrote: > So what do you use? Emacs inside Terminal. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: How popular is Django ?

2008-02-12 Thread James Bennett
On Feb 12, 2008 5:00 AM, tom <[EMAIL PROTECTED]> wrote: > How popular is Django among other Python Web Frameworks (TurboGears, > Pylons, Webware, CherryPy...) ? More popular than rotting meat. Not as popular as sliced bread. Beyond that, hard to narrow down. -- "Bureaucrat Conrad, you are

Re: exclude issue with M2M Field

2008-02-12 Thread James Bennett
On Feb 12, 2008 1:46 PM, Albert Hopkins <[EMAIL PROTECTED]> wrote: > It seems that 'exclude'ing on a M2M field does not have the effect I > anticipated. Am I doing something wrong? Basically I have the > following models The real problem is that the SQL necessary to do an exclude() and have it

Re: Django cannot be used by large web sites?

2008-02-11 Thread James Bennett
On Feb 11, 2008 11:52 PM, a sanjuan <[EMAIL PROTECTED]> wrote: > yes. the pages already make use of includes and of course inheritance, but > each page has unique text content. it is a big commercial website You know, if you've got a bunch of pages with different text, you can use a database to

Re: Django cannot be used by large web sites?

2008-02-11 Thread James Bennett
On Feb 11, 2008 8:43 PM, a sanjuan <[EMAIL PROTECTED]> wrote: > We use includes...those are actually 255 CONTENT pages... You have over 255 URLs which don't offer any logical way to break them up? -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct."

Re: Django cannot be used by large web sites?

2008-02-11 Thread James Bennett
On Feb 11, 2008 12:04 PM, Alex Ezell <[EMAIL PROTECTED]> wrote: > Does anyone else think that 255 urls seems a little crazy? Yes. This sort of thing is what mechanisms like include() are for. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct."

Re: Django cannot be used by large web sites?

2008-02-11 Thread James Bennett
On Feb 11, 2008 11:02 AM, asj2008 <[EMAIL PROTECTED]> wrote: > We are hitting an error that disables the entire website when we have > more than 255 web pages...this is the error we see..has anyone seen > this before? It does not seem to be in the documentation It's a limit hard-coded into

Re: Django cannot be used by large web sites?

2008-02-11 Thread James Bennett
On Feb 11, 2008 11:17 AM, Tim Chase <[EMAIL PROTECTED]> wrote: > There are a couple possibilities that occur to me, but without > seeing the code, it's hard to tell. Functions/methods can > certainly take more than 255 parameters, though it may have to be > done through *args/**kwargs format; or

Re: Generic import

2008-02-11 Thread James Bennett
On Feb 11, 2008 3:41 AM, Rozita <[EMAIL PROTECTED]> wrote: > Can I test another way instead of moving my files? You can hack around with your Python import path (Google will teach you what that means). But you really ought to be developing apps that can live independently of a project folder.

Re: Generic import

2008-02-11 Thread James Bennett
On Feb 11, 2008 3:33 AM, Rozita <[EMAIL PROTECTED]> wrote: > Is there any way that I can omit project name from import statements? Yes. Refactor your code so that the applications are no longer in the project folder, and put them directly on the Python import path instead. This is generally

Re: The best practice for a registration and then getting user to fill up extra information

2008-02-10 Thread James Bennett
On Feb 9, 2008 9:37 AM, Ramdas S <[EMAIL PROTECTED]> wrote: > I am using Django-registration. It works like a charm as far as registering > new users and validating them from potential bots. However, what is the best > practice as far as getting users to feed in more information. See

Re: Simple filter query throwing up an error

2008-02-10 Thread James Bennett
On Feb 10, 2008 5:59 AM, Darthmahon <[EMAIL PROTECTED]> wrote: > Event.objects.filter(date__exact=datetime.now()) > > Simple enough, but it throws up this error: > > AttributeError at /events/today/ > 'module' object has no attribute 'now' You want to read the documentation for Python's datetime

Re: DjangoBook Ch. 7 not working

2008-02-10 Thread James Bennett
On Feb 10, 2008 3:37 AM, rihad <[EMAIL PROTECTED]> wrote: > The first example (the search form) doesn't work either with the same > error (str object is not callable). The book was written for Django 0.96; while most things it covers remain the same in the current development version, not all of

Re: i'm tired

2008-02-09 Thread James Bennett
On Feb 9, 2008 5:48 PM, newbiedoobiedoo <[EMAIL PROTECTED]> wrote: > please take your instructions and put them up somewhere OFFICIAL, > because > I was following directions that were MUCH more complicated. To be perfectly fair, the official installation instructions on djangproject.com tell you

Re: auth/add/user error

2008-02-08 Thread James Bennett
On Feb 8, 2008 1:50 PM, Narso <[EMAIL PROTECTED]> wrote: > Normally this error is not fire, the form's action attribute get > blank. But, when I set the TEMPLATE_STRING_IF_INVALID variable in the > settings file to: >TEMPLATE_STRING_IF_INVALID = 'Variable "%s" out of context' > then the

Re: How to use multiple selection with POST method

2008-02-08 Thread James Bennett
On Feb 8, 2008 9:15 AM, MADDY <[EMAIL PROTECTED]> wrote: > User can select, for example, 3 options (not need to be consecutive) > from 10 possible options using CTRL+mouse. > > When form is submited in database I found only one of those 3 options, > the one at the bottom of 3 selected. You want

Re: Using a drop down list as widget for filter in admin

2008-02-07 Thread James Bennett
On Feb 8, 2008 1:06 AM, Julien <[EMAIL PROTECTED]> wrote: > Doesn't anybody really have an idea how to do this? :) Yes: sit down and take a look at how the admin templates display the list, then think about how you'd change it to produce a element with individual elements for each value. In

Re: Get the current username on models.py

2008-02-07 Thread James Bennett
On Feb 7, 2008 12:15 PM, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > If he's trying to get the logged in user instance in, say, his models > save() *and* he needs this to work from the Admin interface, he > doesn't have request.user available. That's what newforms-admin is for. -- "Bureaucrat

Re: Get the current username on models.py

2008-02-07 Thread James Bennett
On Feb 7, 2008 11:44 AM, Henhiskan <[EMAIL PROTECTED]> wrote: > > See:http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser > > Thanks a lot, is exactly that I was looking for This is a really bad idea; in almost 100% of cases, it's better to be writing something in your view which

Re: Code upgrade

2008-02-06 Thread James Bennett
On Feb 6, 2008 3:30 PM, Chris <[EMAIL PROTECTED]> wrote: > Does magic removal help to upgrade code from 91 to present or is it a > set of code used to assist with writing a potential application that > could do this? "Magic-removal" is not a script or a piece of code. It was the name given to

Re: User permissions

2008-02-06 Thread James Bennett
On Feb 6, 2008 4:38 PM, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote: > ... though given the choices, I'd be inclined to wager that it's > closer to "now" than to "the heat death of the universe"... Probably, but I always include that in the time scale just in case. You know how tricky it is to

Re: User permissions

2008-02-06 Thread James Bennett
On Feb 6, 2008 11:57 AM, Erwin <[EMAIL PROTECTED]> wrote: > That sounds quite interesting, but I'm not totally sure what you are > referring to. Do you mean the hooks the newforms admin branch provides > or maybe the possibilities of the row-level permissions branch? newforms-admin.

Re: Read-only connection to database. How to?

2008-02-06 Thread James Bennett
On Feb 6, 2008 1:43 AM, koenb <[EMAIL PROTECTED]> wrote: > You could take a look at the multidb branch (specifically check out > ticket #4747). It is a bit behind on trunk, but the basics should > work. It allows you to define multiple connections, so you should be > able to connect to the same

Re: Code upgrade

2008-02-05 Thread James Bennett
On Feb 5, 2008 12:33 PM, David Marquis <[EMAIL PROTECTED]> wrote: > If you didn't make any change to the Django source base, you can > simply download the latest release and install the new version. > If needed, you could also download the latest development version > through the Subversion

Re: django.contrib.auth login method incorrectly documented?

2008-02-04 Thread James Bennett
On Feb 4, 2008 2:50 PM, Mojave <[EMAIL PROTECTED]> wrote: > Docs say I pass both the request object and the authenticated user > object to the login method, but that fails - login expects only one > argument. Odds are that you are trying to call the *view* function

Re: Accessing the Admin class

2008-02-04 Thread James Bennett
On Feb 4, 2008 1:35 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I'm confused. Normally, you can access an inner class simply: ...snip... > but this dosen't work with Admin: That's because django.db.models.Model is not a "normal" class, and hence no Django model class is; it has a

Re: Foreign key being set to null when not null in form

2008-02-04 Thread James Bennett
On Feb 4, 2008 6:43 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > as you can see, I hide the primary and foreign key fields (yes, I am > aware of the security implications: can we fix the real problem > please ;-) This is a real problem. You need to fix it, or someone will hack you. > >

Re: Read-only connection to database. How to?

2008-02-03 Thread James Bennett
On Feb 3, 2008 7:59 PM, Julien <[EMAIL PROTECTED]> wrote: > Could you please indicate how to do this? Once again, either: 1. Set up a second Django settings file, fill in the read-only user there, and use that settings file for the site that your clients use. 2. Write your custom query method

Re: Read-only connection to database. How to?

2008-02-03 Thread James Bennett
On Feb 3, 2008 6:37 AM, Julien <[EMAIL PROTECTED]> wrote: > I found a trick that works for my use case. I just don't execute if > it's not a SELECT request. I do the test like so: Things your filter doesn't catch: * PostgreSQL's table-creating SELECT INTO statement. * Any "query" which consists

Re: Read-only connection to database. How to?

2008-02-03 Thread James Bennett
On Feb 3, 2008 4:00 AM, Julien <[EMAIL PROTECTED]> wrote: > What should I change to force the read-only access? Create a new database-level user, and grant that user SELECT but nothing else. Then fill in those credentials in the settings file used by the site. You can always set up a read/write

Re: Image upload in user's directory

2008-02-01 Thread James Bennett
On Feb 1, 2008 12:57 AM, django_user <[EMAIL PROTECTED]> wrote: > I want every image to be uploaded in the users directory like '// > %y/%m/%d' instead of all files in default location. There is no built-in automatic solution for this. However, like many things which are not built-in or

Re: User permissions

2008-01-31 Thread James Bennett
On Jan 31, 2008 5:06 PM, Chris <[EMAIL PROTECTED]> wrote: > I've been reading up on user permissions and I have found that user > permissions are on a per-model basis. My question: If I have a photo > gallery application, and I have several uses who can post their > galleries to this application.

Re: *Occasional* PostgreSQL Error

2008-01-30 Thread James Bennett
On Jan 30, 2008 8:55 PM, Mark Green <[EMAIL PROTECTED]> wrote: > What ressources are held and wasted exactly? > Maintaining a number of open TCP connection is much cheaper > than creating/discarding them at a high rate. Every connection that one Django application holds on to is a connection

Re: *Occasional* PostgreSQL Error

2008-01-30 Thread James Bennett
On Jan 30, 2008 6:01 PM, Mark Green <[EMAIL PROTECTED]> wrote: > Ahem, there's a huge difference between being confronted with > a spinner/progress bar or an error page. The former speaks > "Please wait", the latter speaks "Try again". OK, so let's break this down. There are two potential cases

Re: why did admin delete my data?

2008-01-30 Thread James Bennett
On Jan 30, 2008 2:22 PM, Carl Karsten <[EMAIL PROTECTED]> wrote: > title = models.CharField("Title", core=True, max_length=80, blank=True, > null=True) > surname = models.CharField("Surname", max_length=65, core=True, > blank=True, > null=True) There's your culprit. Whenever you try

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