Re: django admin - too many sql-queries

2007-02-18 Thread James Bennett
On 2/18/07, VIK_Tomas <[EMAIL PROTECTED]> wrote: > class Action(models.Model): >name = models.CharField(maxlength=64, unique=True) >photo = models.ForeignKey('Photo', null=True, blank=True) Set 'raw_id_admin=True' on the 'photo' field -- otherwise Django will query the full list of Photos

Re: Admin without Auth

2007-02-19 Thread James Bennett
On 2/19/07, kbochert <[EMAIL PROTECTED]> wrote: > Is there a was to install the contrib.admin app without the > contrib.auth app?? No; the admin app requires the auth app so that it can allow authorized users to log in. > While learning, I am eraseing the database and doing manage.py syncdb > a

Re: Admin without Auth

2007-02-19 Thread James Bennett
On 2/19/07, kbochert <[EMAIL PROTECTED]> wrote: > -- I see how to provide a .sql file, but how do I put a super user in > it? Something like BEGIN; INSERT INTO "auth_user" ('username', 'email', 'password') VALUES ('me', '[EMAIL PROTECTED]', 'my_hashed_password'); COMMIT; Just straightforward SQ

Re: Admin without Auth

2007-02-19 Thread James Bennett
On 2/19/07, James Bennett <[EMAIL PROTECTED]> wrote: > Something like > > BEGIN; > INSERT INTO "auth_user" ('username', 'email', 'password') VALUES > ('me', '[EMAIL PROTECTED]', 'my_hashed_password')

Re: Admin without Auth

2007-02-19 Thread James Bennett
On 2/19/07, kbochert <[EMAIL PROTECTED]> wrote: > How do I generate a hashed password? The easiest way is actually to manually create the superuser once during a syncdb run, and then copy/paste the hash out of the admin page for that user. You can manually generate a hash if you want to, but it's

Re: Admin without Auth

2007-02-19 Thread James Bennett
On 2/19/07, kbochert <[EMAIL PROTECTED]> wrote: > No luck. I put: > > BEGIN; > INSERT INTO "auth_user" ('username', 'email', 'password') VALUES > ('admin', '[EMAIL PROTECTED]', 'sha1$b0461$2ed273ea30cf73581'); #'admin' > COMMIT; > > BEGIN; > INSERT INTO "auth_user" ('is_staff', 'is_active'

Re: Postgre and mysql

2007-02-21 Thread James Bennett
On 2/21/07, Grupo Django <[EMAIL PROTECTED]> wrote: > Hello, I want to know which of these two databases are prefered by > django. I can choose and I'd like to know if there is some differences > in performance or integration (like foreign keys). > If someone knows a comparative between both of th

Re: my problem from HELL: Pleas help me out on this

2007-02-21 Thread James Bennett
On 2/21/07, enquest <[EMAIL PROTECTED]> wrote: > It seems as soon I import "from bar.models import Test" do then this > class will not show up in the the ADMIN. I restarted apache 100 time, > changed the code 100 times to figure out. Tryied everthing. But as soon > as I do an "import Test" for exa

Re: staff_member_required

2007-02-23 Thread James Bennett
On 2/23/07, sansmojo <[EMAIL PROTECTED]> wrote: > Here's my views/admin.py (note that everything works, until I added > line 10 - "@staff_member_required"): You're probably using Python 2.3, which doesn't support the @ syntax for decorators. Instead of using that, below the view function add thi

Re: Pycon Djangonauts

2007-02-23 Thread James Bennett
On 2/23/07, Eric Walstad <[EMAIL PROTECTED]> wrote: > George Song is organizing a(nother) Django show-n-tell for tomorrow > (Saturday, 2/24/7) at 4:05PM. Tonight he demo'ed a couple apps he's > worked on recently. Very cool, innovative stuff. There should be more > neat stuff to see at tomorrow

Django snippets

2007-02-25 Thread James Bennett
For a while now I've been annoyed with the fact that, while it's relatively easy to build and advertise a complete Django application, it's relatively hard to advertise smaller pieces of useful code; there are tons of things in the "Cookbook" section of the wiki and on people's blogs, but it's alm

Re: does Django cache work across scripts?

2007-02-25 Thread James Bennett
On 2/25/07, Jaanus <[EMAIL PROTECTED]> wrote: > API, from where the web side of things can pick it up? 1) will it work > (of course I'll also try out myself, but I thought I'd consult a bit > first) and 2) is it a nice/"right" way of doing things? maybe I should > look at some other architectural

Re: Django snippets

2007-02-25 Thread James Bennett
On 2/25/07, limodou <[EMAIL PROTECTED]> wrote: > Can you add RSS to the site, so that I can subscribe it to see the > newest entries. There's some very basic feed code in the app already, but it's not quite done and I want to get it right before I start exposing it :) -- "Bureaucrat Conrad, you

Re: Django snippets

2007-02-25 Thread James Bennett
Also, a few people have mentioned not getting account activation emails; I don't know what's up with that, but I just manually activated a bunch of accounts. If you register and don't get an activation email within twelve hours, let me know (email me directly -- don't spam the list) and I'll take

Re: Django snippets

2007-02-25 Thread James Bennett
On 2/25/07, limodou <[EMAIL PROTECTED]> wrote: > For displaying snippets, maybe the description is under the code but > not in right side is better. Because some description maybe long, and > the right side is too narrow to display. And if I can write the > description in ReST? Probably not going

Upcoming Django release, and the future

2007-02-25 Thread James Bennett
Upcoming Django release, and the future As we sit here in warm, sunny Dallas, meditating on how next year's PyCon will be in cold, cloudy Chicago, we're also getting ready to push out a new release of Django, and with that there are some things you all need to know, and as your friendly neighborh

Re: Django snippets

2007-02-26 Thread James Bennett
On 2/26/07, akaihola <[EMAIL PROTECTED]> wrote: > One small note: > The e-mail field when registering to www.djangosnippets.org is too > short for the e-mail address I use for on-line services. Do you mean it throws a validation error? Or that the field is too small for you to see the whole addre

Re: Django snippets

2007-02-26 Thread James Bennett
I hate to spam the list, but since I'm being inundated... I've now pointed out in multiple places that I'm working on RSS feeds, but that they weren't quite ready when I wanted to launch. *please* stop emailing me about feeds; they're coming, but I need to do a little work. -- "Bureaucrat Conr

Re: Re[2]: Upcoming Django release, and the future

2007-02-26 Thread James Bennett
On 2/26/07, Andrew Diederich <[EMAIL PROTECTED]> wrote: > On Monday, February 26, 2007, 3:00:30 PM, Jacob Kaplan-Moss wrote: > > For the other bit, though, see [4624]. > > This ticket doesn't exist. I looked for similarly numbered ones, but > didn't find it. That's changeset 4624, not ticket 4624

Re: from .95 to six

2007-02-27 Thread James Bennett
On 2/27/07, Perica Zivkovic <[EMAIL PROTECTED]> wrote: > portable python includes 0.96-pre revision 4293. I got it straight > from the subversion when I was making first release of PP. It's not > the latest subversion snapshot but it s 0.96 (about one month old svn > revision) It's not "Django 0.

Re: Generating object documentation from its instance

2007-02-27 Thread James Bennett
On 2/28/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Basic use for me would be to pass a [newform] object, and it would output its > methods (with docstrings), attributes, and if attributes are objects, > recursively build their auto-documentation. The function used as the example in Chapte

Re: published permission

2007-02-28 Thread James Bennett
On 2/28/07, Mary <[EMAIL PROTECTED]> wrote: > All what i want is to make the published field to appear for certain > user only in the admin interface There is currently no way to do this without essentially rewriting the entire admin interface; it would be better to write your own views which han

Re: datetime format and client preferred language?!?!

2007-03-01 Thread James Bennett
On 3/1/07, Jens Diemer <[EMAIL PROTECTED]> wrote: > How can i send a datetime in the client preferred format? Note: i don't > wand to use a template filter to handle this ;) And yet this is *exactly* what the 'date' template filter is for; it's a presentation issue, so a filter in the presentatio

Re: [help] passing a md5 digest string into URL

2007-03-01 Thread James Bennett
On 2/27/07, Giuseppe Franchi <[EMAIL PROTECTED]> wrote: > Hello everyone... again. :) > As i said, i need to pass in my URL a variable, wich is the > result of a md5 digest. > (no private information... only a validation key). An md5 hex digest is always 32 characters long, containing digits and

Re: Can django apps be compiled for shrinkwrapped applications?

2007-03-01 Thread James Bennett
On 3/1/07, Jeremy Dunck <[EMAIL PROTECTED]> wrote: > If you're just concerned about not having source available, you can > run this over all your files: > http://docs.python.org/lib/module-compileall.html (but keep in mind that Python bytecode isn't terribly hard to reverse-engineer, and introduc

Re: user.get_profile()

2007-03-01 Thread James Bennett
On 2/28/07, MattW <[EMAIL PROTECTED]> wrote: > ValueError at /accounts/profile/ > too many values to unpack You've probably put a full Python path into the value of AUTH_PROFILE_MODULE, when it expects 'appname.modelname' instead. -- "Bureaucrat Conrad, you are technically correct -- the best k

Re: Admin customisation

2007-03-02 Thread James Bennett
On 3/2/07, Fes <[EMAIL PROTECTED]> wrote: > I have a model which has fields that have been set using a form. > However I would like to incorporate this model into the admin > interface. I would like to know if it is possible for this model to > only have the "Change" rights. For example when the u

Re: ABSOLUTE_URL_OVERRIDES issue

2007-03-03 Thread James Bennett
On 2/28/07, Nicolas Steinmetz <[EMAIL PROTECTED]> wrote: > I added the following piece of "code" in settings.py (is it the right > place ?) but it does not work (it looks it's not take into account with > django svn 4643). > > ABSOLUTE_URL_OVERRIDES = { > 'cab.Language' : lambda o: "/snippets/

Re: Only getting 500 error, not 404

2007-03-03 Thread James Bennett
On 3/4/07, puzzler <[EMAIL PROTECTED]> wrote: > Any idea why I'm not getting 404 errors for these situations? Assuming you've set up the ADMINS setting so it emails you tracebacks on these errors, what's in the traceback? -- "Bureaucrat Conrad, you are technically correct -- the best kind of co

Re: Adding fields to comment-form

2007-03-04 Thread James Bennett
On 3/4/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > If you want to extend the current versions have a look at > http://www.b-list.org/weblog/2006/07/16/django-tips-hacking-freecomment I'm planning to release an app fairly soon which handles some of that (mostly the moderation and Akismet b

Re: Admin site

2007-03-04 Thread James Bennett
On 3/4/07, Arafel <[EMAIL PROTECTED]> wrote: > Quick question: How can i make the model names not pluralize in the > admin site? In the "class Meta" part of your model definition, add "verbose_name_plural". For example, if you had this: class MyModel(models.Model): ...fields defined here...

Re: regarding ManyToManyField help

2007-03-04 Thread James Bennett
On 3/5/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Or you could change the display_teacher() method itself to map each of > the list contents through str() in order to return a list of strings. (or define __repr__) -- "Bureaucrat Conrad, you are technically correct -- the best kind of c

Re: regarding ManyToManyField help

2007-03-04 Thread James Bennett
On 3/5/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > You'd have to define __repr__ on the QuerySet, wouldn't you? Since > that's what is being displayed there (display_teacher() is returning a > QuerySet). Or am I missing something obvious? The problem is that the __repr__ of the QuerySet u

Re: Getting the Hjang of Django?

2007-03-05 Thread James Bennett
On 3/5/07, cjl <[EMAIL PROTECTED]> wrote: > After browsing through the Django Users and Django Developers groups, > I started to wonder which branch I should be using as I learn. I'd recommend starting on trunk and maybe sticking to 0.96 once it's released. After 0.96 there will be some big chang

Re: Designing URLs

2007-03-06 Thread James Bennett
On 3/6/07, Filipe Correia <[EMAIL PROTECTED]> wrote: > Is there any criteria that can in fact be considered a best practice > when designing URLs? > I would very much appreciate to know of other's experience on this. In my experience, it's fairly subjective. Personally, I don't like having a slas

Re: Error with a model? (I think)

2007-03-06 Thread James Bennett
On 3/6/07, Austin Govella <[EMAIL PROTECTED]> wrote: > "unbound method contribute_to_class() must be called with TextField > instance as first argument (got ModelBase instance instead)" Did you type 'TextField' where you meant 'TextField()' ? -- "Bureaucrat Conrad, you are technically correct -

Re: New framework configuration

2007-03-07 Thread James Bennett
On 3/7/07, jlnn <[EMAIL PROTECTED]> wrote: > We're trying to set up a framework for our developers. We're using a > standard install of RHEL ES4. If we modify the configuration to use > Python 2.4 the admin tools break and RedHat won't support the > installation. We've tried using Python 2.3, but

Re: Django keeps growing, performance keeps dropping

2007-03-07 Thread James Bennett
On 3/7/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I think the problem lies in the forum (a modified Myghtyboard install) > and in it's relationship to users. Since both forum posts and users > keeps growing, I wonder if I've created some sort of exponential > growth situation for myself.

Re: Python HTML lib_filter

2007-03-07 Thread James Bennett
On 3/7/07, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > this is pretty much exactly what i had been looking for lately... It's also worth pointing out that Django includes a "striptags" template filter which strips all HTML tags, and that python-markdown has a "safe mode" which strips raw

Re: Python HTML lib_filter

2007-03-08 Thread James Bennett
On 3/8/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > What I'd like to see (and maybe it's built-in somewhere and I've > overlooked it) is some sort of naughty-word filter. Have a look at django.core.validators.hasNoProfanities, which looks for a list of disallowed words in settings.PROFANITI

Re: Python HTML lib_filter

2007-03-08 Thread James Bennett
On 3/8/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Is that only for comments, though? Guess I could genericize it. > Managed to do so for karma, so I guess I could for profanities, too. No, the validator itself is in django.core.validators. The comments system will optionally apply that v

Re: What's available in a view

2007-03-08 Thread James Bennett
On 3/8/07, fyl <[EMAIL PROTECTED]> wrote: > This is somewhere between an observation and a question. I am writing > a view that needs to know "some stuff", in particular > HTTP_ACCEPT_LANGUAGE. As I read the developing book and look at the on- > line documentation, it is not clear what is availabl

Re: video uploads (like you tube)

2007-03-09 Thread James Bennett
On 1/25/07, Pythoni <[EMAIL PROTECTED]> wrote: > Is http://www.kindfish.com/ > really Dajngo powered, including uploading? > Lad They claim to be. I haven't seen their source code, but I have no reason to suspect they'd lie about using Django... -- "Bureaucrat Conrad, you are technically correc

Re: Inline incompatibility/issue?

2007-03-09 Thread James Bennett
On 3/9/07, Rob J Goedman <[EMAIL PROTECTED]> wrote: > If I upgrade to revision 4693 (or higher) I get below error. Revision 4692 > works fine. I need to do some digging to see what's up with that; it's definitely the changeset, not your code. -- "Bureaucrat Conrad, you are technically correct -

Re: choosing ajax framework (for my projects) :)

2007-03-09 Thread James Bennett
On 3/9/07, ashwoods <[EMAIL PROTECTED]> wrote: > id say pretty simple stuff. but where should i start? prototype, mojo, > mochi, and thousands of others. > what would you recommend, those of you who have experience? :) I wrote up some purely subjective thoughts on this a while back: http://www.b

Re: Inline incompatibility/issue?

2007-03-09 Thread James Bennett
On 3/9/07, James Bennett <[EMAIL PROTECTED]> wrote: > I need to do some digging to see what's up with that; it's definitely > the changeset, not your code. (and that changeset has been backed out) -- "Bureaucrat Conrad, you are technically correct

Re: Api and user auth

2007-03-09 Thread James Bennett
On 3/7/07, Grupo Django <[EMAIL PROTECTED]> wrote: > - I have made a news app. One of the fields is author, i want to set > its default value to the username logged in the admin zone. How could > I do it? What do I have to import to use request.username? so I would > do: default= request.username,

Re: Document type/Charset issues?

2007-03-09 Thread James Bennett
On 3/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > also, google webmaster tools reports that the majority (about 80%, but > not all) of the site is US-ASCII, not UTF-8 The 'meta' element is basically meaningless; it's used as a last resort when no other information is available. Your serv

Re: OperationalError: Unable to close due to unfinalised statements

2007-03-10 Thread James Bennett
On 3/10/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > OperationalError: Unable to close due to unfinalised statements Usually this means that there's a permissions issue with SQLite. This often pops up when switching from the development server to Apache, because on hosting services Apache a

Re: OperationalError: Unable to close due to unfinalised statements

2007-03-10 Thread James Bennett
On 3/10/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > do you mean that the directory and file of SQLite database file shall > be able to be written by Apache? Yes. TO use SQLite under Apache/mod_python, the SQLite database must be readable and writable by the user Apache is running as. Wheth

Re: OperationalError: Unable to close due to unfinalised statements

2007-03-10 Thread James Bennett
On 3/10/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Ok, thanks. Now it solved. I am moving the database file to a > directory that writable to others and change the database file > permission to be writable by others. But I think it will be a security > issue. What do you suggest? If you'

Re: Django admin site

2007-03-10 Thread James Bennett
On 3/10/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > When deploying site using apache + mod_python, how to make it can read > Django admin css? Let say I am using a share webhosting. This is covered in the "serving media files" and "serving the admin files" sections of the mod_python deploy

Re: search_fields: search is unrestricted

2007-03-11 Thread James Bennett
On 3/11/07, Laurie <[EMAIL PROTECTED]> wrote: > I don't think there's any way to get Django to log the SQL it's > executing, so I don't know if it's issuing any 'WHERE x ILIKE y' type > clauses, but functionally I'm not getting search filtering. When the DEBUG setting is True, Django keeps a list

Re: search_fields: search is unrestricted

2007-03-11 Thread James Bennett
On 3/11/07, Laurie <[EMAIL PROTECTED]> wrote: > Ah, that might help if I can figure out where to call it from... Is > the list preserved across requests? Could I implement a view that I > could hit whenever I need to check 'what just happened to the > database'? The query list only lives as long

Re: (x)html tags used to render newforms

2007-03-11 Thread James Bennett
On 3/11/07, Frédéric Roland <[EMAIL PROTECTED]> wrote: > I was discussing about layout of forms using CSS and heard that there > was some tags such as fieldset, label and legend that should allow us to > make the layout of forms without tables. Is there a reason these tags > aren't used to render

Re: Django Automatic Page Refreshing

2007-03-11 Thread James Bennett
On 3/11/07, johnny <[EMAIL PROTECTED]> wrote: > I have an online seminar booking application. What I want to know is, > if 100 people are currently > viewing a room that holds max 200 people, and one person out of 100 > books the seat in the room, how do > I refresh all the 100 pages so that they

Re: Multi-tenant database

2007-03-12 Thread James Bennett
On 3/12/07, zin <[EMAIL PROTECTED]> wrote: > Is Django suitable for multi-tenant database application? i.e. > combining username and company_id as primary key Django does not currently have support for composite keys. You can fake this to a certain extent with unique_together, but from Django's p

Re: Permalink decorator and generic views, revisited

2007-03-12 Thread James Bennett
On 3/12/07, dchandek <[EMAIL PROTECTED]> wrote: > Am I missing something? It's not that 'permalink' doesn't work with generic views -- it can. As I understand it, the problem is a URLConf like this: urlpatterns = patterns('django.views.generic.list_detail', (r'^foo/(?P\d+)/$', 'object_detail

Re: Designing for Speed - conditionals inside the view versus the template

2007-03-12 Thread James Bennett
On 3/12/07, Bill de hOra <[EMAIL PROTECTED]> wrote: > Merric Mercer wrote: > > > 1. Design a template with lots of {% if %} conditional statements > > > > 2. Do the bulk of the work in the view, by doing something like:- > > > > 3. Do a combination of the two above > > 4: Caching? 5. Start

Re: Implementing an 'extent' query

2007-03-13 Thread James Bennett
On 3/13/07, Laurie Harper <[EMAIL PROTECTED]> wrote: > Is there anything like this already in Django? Django currently does not support model subclassing -- if anything happens to work, it's more accident than anything else, because proper support for model subclassing is still being worked on.

Re: sql log

2007-03-13 Thread James Bennett
On 3/13/07, Greg Donald <[EMAIL PROTECTED]> wrote: > How can I see the sql Django produces? Is it being logged somewhere > or can I configure Django to log it somewhere? I realize I can look > at the logs from my db server but I'm wanting just the queries > produced by Django itself. http://www

Re: Question on Django ORM

2007-03-13 Thread James Bennett
On 3/13/07, devdiscuss <[EMAIL PROTECTED]> wrote: > Hi, does the ORM in Django support nested objects? For instance, > assuming I have a User model which should have multiple mailing > addresses, can I encapsulate the address information (street, city, > state, etc.) into an object vs. individual

Re: field model from external app, won't show up

2007-03-13 Thread James Bennett
On 3/13/07, Panos Laganakos <[EMAIL PROTECTED]> wrote: > then in the template file I try to: > {% for tag in object.get_tag_list %} {{ tag.name }} {% endfor %} The many-to-many relationship will set up an accessor 'tag_set' which is a manager; the correct form in pure Python would be for tag in

Re: Checking whether an app is installed?

2007-03-14 Thread James Bennett
On 3/14/07, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote: > Is there a function for checking whether an app was installed in the > current project? Currently, the list of apps on the default admin index page is generated by the 'get_admin_app_list' template tag, which just returns a list of apps.

Re: DATE FORMAT ISSUE AGAIN.

2007-03-14 Thread James Bennett
On 3/14/07, mralokkp <[EMAIL PROTECTED]> wrote: > Could not parse the remainder: | date: "F j Y" No spaces before or after the bar, no spaces before or after the colon: {{ somvar|date:"F j y" }} -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~-

Re: newb: Django ORM for Custom SQL

2007-03-15 Thread James Bennett
On 3/15/07, johnny <[EMAIL PROTECTED]> wrote: > I need to retrieve latest record (each record has a time stamp, > created_at), only one record, from sale table where product_id=1. How > do I do this in Django ORM? I have looked at .objects.extra{}, but I > am getting ProgrammingError 1064. OK,

Re: Importing without 'site.' in django apps.

2007-03-15 Thread James Bennett
On 3/15/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > it's entirely up to you how you set that up. I use the latter form of > imports all the time in my work -- if all the apps are under a single > project directory (which isn't always true), I point the Python path to > the project director

Re: Strange filtering issue

2007-03-15 Thread James Bennett
On 3/15/07, Matias Surdi <[EMAIL PROTECTED]> wrote: > published_posts_dict = {'queryset': > Post.objects.filter(pub_date__lte=datetime.now()).filter(status='PB').order_by('-pub_date')} > > the problem is, with the filter pub_date__lte=datetime.now() . > > What happens,is that when I add a new post

Re: Newforms: Is the current method of multiple field comparison the best way?

2007-03-16 Thread James Bennett
On 3/16/07, Ian <[EMAIL PROTECTED]> wrote: > The purpose of web development frameworks is to make common web > development tasks easier, or give them to you for free. A forms > framework which requires custom code for password comparisons does not > satisfy this fundamental requirement. While I

Re: Wiki account

2007-03-16 Thread James Bennett
On 3/16/07, Todd O'Bryan <[EMAIL PROTECTED]> wrote: > I just edited a Wiki page and maybe I'm dense, but I couldn't figure out > how to create an account, so I had to do it anonymously. You should be able to get Tract to remember you by clicking the "settings" link right above the nav bar and fil

Re: defecting to django from rails

2007-03-17 Thread James Bennett
On 3/17/07, rubdabadub <[EMAIL PROTECTED]> wrote: > 1. How about deployment? Capistrano works with django i mean you can > make so called recipe but is there anything like that in python > world.. I don't know of a direct analogue off the top of my head, but at work we've actually been using Capi

Re: defecting to django from rails

2007-03-17 Thread James Bennett
On 3/17/07, James Bennett <[EMAIL PROTECTED]> wrote: > There's also a list of more general resources, including third-party > documentation and applications with code you can look at: > Pasted the wrong link there, should have been http://code.djangoproject.com/

Re: svn 400 bad request

2007-03-18 Thread James Bennett
On 3/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > In my case, the problem is due to the firewall setting which I have no > power to alter. But if the subversion repository can support the https > protocol, svn can connect to it with no problem. > > I wonder if Django team can add the http

Re: Authentication Issues...

2007-03-19 Thread James Bennett
On 3/19/07, mediumgrade <[EMAIL PROTECTED]> wrote: > I am not sure what the difference is between RequestContext and > Context (I am still fairly new to Django and Python). RequestContext automatically adds some extra variables to the context of every template that uses it; exactly which variable

Re: Django Stuff

2007-03-19 Thread James Bennett
On 3/19/07, Mary <[EMAIL PROTECTED]> wrote: > Does Django Stuff works with latest stable version for Django which is > 0.95.1 ?? What is "Django Stuff"? -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ You re

Re: Django and referential integrity.

2007-03-19 Thread James Bennett
On 3/19/07, Grupo Django <[EMAIL PROTECTED]> wrote: > > Does Django support referential integrity? Django does its best to emulate integrity features when they are not present in the underlying database (for example, if you delete an object to which other objects were related via foreign keys, Dj

Re: __search works in mysterious ways.

2007-03-19 Thread James Bennett
On 3/19/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > That's not what I would have expected to see. Have a look at the SQL > that Django is generating and see if there are any clues there. To do > that, make sure you have DEBUG=True in your settings file (which you > will have by default) an

Re: MySQLdb version

2007-03-20 Thread James Bennett
On 3/20/07, chasfs <[EMAIL PROTECTED]> wrote: > The problem is that the MySQLdb page says that 1.2.1p2 has no changes > that we should worry about. Why is p2 required? Unfortunately, there is a change that we need to worry about: the thread-safety bug in MySQLdb which caused ticket #3279[1] wasn

Re: Blocking IP with middleware?

2007-03-21 Thread James Bennett
On 3/21/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Looking at my logs, I saw a gazillion requests from 81.208.31.216, > which I believe is a malicious bot. I understand there's a way to use > middleware to block IPs, but could somebody elaborate on that, or > point me in the right directio

Re: Database exception handling please

2007-03-21 Thread James Bennett
On Wed, 2007-03-21 at 16:47 -0700, Gerard M wrote: > Hello django community, I have a HUGE problem, and I would like to > know if some of you guys can help me, the problem is: Im accesing a > database and there is a big chance of not finding the item im looking > for, this is the snipplet of code

Re: manage.py startapp suggestions

2007-03-21 Thread James Bennett
On 3/21/07, Tom Smith <[EMAIL PROTECTED]> wrote: > This is my very crude attempt, which first calls startapp, then does > standard stuff that ALWAYS seem to have to do and ALWAYS forget like: > Add a urls.py for my app... > Add a URL pattern to load static images > Create the folder to host the

Re: Database exception handling please

2007-03-21 Thread James Bennett
On 3/21/07, ZebZiggle <[EMAIL PROTECTED]> wrote: > I'm going to have to deal with this, so here's what I'm thinking: some > sort of helper function that will do a filter() but act as a .get() in > that it only returns 1, but in the event more than 1 comes back notify > the admin that the integrity

Re: manage.py startapp suggestions

2007-03-22 Thread James Bennett
On 3/22/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > my head -- every time additions are proposed. In this case, my feeling > is that adding this extra functionality to management.py -- the core > management routines in Django -- is not the right place. I agree it doesn't belong in managem

Announcing Django 0.96!

2007-03-23 Thread James Bennett
We're pleased to announce the release of Django 0.96 today; this release involves cleanup and stabilization of features from the 0.95 release, along with some nice new features: an integrated testing framework, the first release of the newforms library, and a ton of useful improvements. There are

Re: Custom SQL - Do I need to close the connection?

2007-03-24 Thread James Bennett
On 3/22/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Do I need to close the connection after I'm done with the results? > I've also recently started receiving 'too many connections' errors... > and thought this might be the reason? Django will automatically close the connection at the end o

Re: Announcing Django 0.96!

2007-03-24 Thread James Bennett
On 3/24/07, Marc Fargas Esteve <[EMAIL PROTECTED]> wrote: > Maybe the release notes should say that newforms do not yet support File > uploads in an easy way (see #3297) just to warn people moving from oldforms > to newforms ;) The release notes, I believe, mention that newforms is still under de

Re: name 'current_datetime' is not defined

2007-03-24 Thread James Bennett
On 3/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Like the commentor before, I could not get this example to run. > However, applying what he suggested, ie. specifying current_datetime > as a string instead, it runs now. Using a function directly, instead of a string, is included in

Re: syncdb & postgreSQL

2007-03-24 Thread James Bennett
On 3/24/07, jewe <[EMAIL PROTECTED]> wrote: > The constraints was now creates with a new nameconstruct. > i.E.: team_id_refs_team_id_6e4cb777 > > The referenced tabel was now named without the tablename. I assume > that's a hash-value.(?) Yes, the way Django names database constraints changed bet

Re: Newbie problem with view/model interaction

2007-03-24 Thread James Bennett
On 3/24/07, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: > Not related to your question, but this is called 'template' in Django. > 'View' means a different thing (a controller). Well, Django doesn't really have anything that strictly matches the "controller" aspect; even Martin Fowler in his writeup

Re: Adding a field to a model

2007-03-24 Thread James Bennett
On 3/24/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > (3) At your database prompt ("manage.py shell" and go from there), > execute "ALTER TABLE ADD COLUMN ... DEFAULT ...", filling in the first > "..." part with the column definition you noted before. You will also > need to add a DEFAULT va

Re: ImportError: MySQLdb-1.2.1p2 or newer is required; you have 1.2.1g3

2007-03-25 Thread James Bennett
On 3/25/07, coulix <[EMAIL PROTECTED]> wrote: > Apparently we need to upgrade Mysql, which is already the 5.0 on my > host and no latest version is available, or put mysql_old in the > settings.py. No, MySQL is the database server, and does not need to be upgraded. MySQLdb (note the "db" on the

Re: sql log

2007-03-26 Thread James Bennett
On 3/26/07, gdonald <[EMAIL PROTECTED]> wrote: > I tried a couple of page reloads, stuff I know is querying the > database, still nothing. It resets at the end of each page load, and each request/response cycle gets its own copy, so you need to access it from within that. The 'debug' context proc

Re: Get function name after....

2007-03-27 Thread James Bennett
On 3/27/07, Mario Gonzalez <[EMAIL PROTECTED]> wrote: > however always I've got a "_wrapped_view" name. Is there a way to > find out, for example if my request.path is one/ to get app_one.idex > as a string? 'resolve' returns the actual callable function in all cases, so if you want the string

Re: Get function name after....

2007-03-27 Thread James Bennett
On 3/27/07, Mario Gonzalez <[EMAIL PROTECTED]> wrote: > class AuthorizedMiddleware(object): > > def process_request(self, request): > return HttpResponse(str( resolve(request.path)[0].__name__ )) Also, keep in mind that writing a 'process_view' method instead will give you access to t

Re: Does the server have to restarted when you make a change to the code?

2007-03-27 Thread James Bennett
On 3/27/07, walterbyrd <[EMAIL PROTECTED]> wrote: > Is that post correct? You have to restart the server whenever you make > a change to the django code? For templates, no. For changes to the actual Python code in use, generally yes. The reason for this is that, under both mod_python and FastCGI

Re: Need to bypass login decorator

2007-03-27 Thread James Bennett
On 3/27/07, Orin <[EMAIL PROTECTED]> wrote: > I'm coding dtests for django views. I'm using mock object as django > request, but don't know how to emulate user session (session id). > Because of login decorator I can't access the other parts of my > function. The built-in Django test client can s

Re: URL prefix in applications and templates.

2007-03-27 Thread James Bennett
On 3/27/07, Michael Lake <[EMAIL PROTECTED]> wrote: > So my question is if some consensus has developed or is there a 'proper' > method for > dealing with this? The "url" template tag is the solution to this; instead of giving it a URL, you give it the name of a view, and it looks through the UR

Re: manage.py setting sys.path wrong

2007-03-29 Thread James Bennett
On 3/29/07, Lukas Kolbe <[EMAIL PROTECTED]> wrote: > Okay. I renamed my project from "site" to another name ... and voila, > everything works as expected. Yeah, that was almost certainly a conflict with the built-in Python module 'site'[1]. There are some checks in manage.py now which do their be

Re: Building PythonMagick

2007-03-29 Thread James Bennett
On 3/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Django does not require PythonMagick. > It is recommended you install PIL, but that also is not a requirement. PIL is required if any of your models have an ImageField in them; otherwise it's not. -- "Bureaucrat Conrad, you are technica

Re: A silly question from a tired a man

2007-03-29 Thread James Bennett
On 3/29/07, olive <[EMAIL PROTECTED]> wrote: > This is the request.POST I get from a (new)form: > ['Register'], 'countries': ['DE', 'ES']}> > > No I want to have the 'countries' list but request.POST[''countries'] > gives me 'ES' instead of the entire list. Because HTTP allows multiple values to

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