Re: Arithmetic operations in a templete

2007-09-13 Thread James Bennett
On 9/13/07, Scott Anderson <[EMAIL PROTECTED]> wrote: > What I'm hoping, however, is that this missive was moot, because you'll > say, "no, Scott, you should just do *this*:", followed by an elegant and > reasonable solution that I, as a relative newcomer to Django, have not > yet considered. Here

Re: how to link to previous and next objects in object_detail view ?

2007-09-15 Thread James Bennett
On 9/15/07, akonsu <[EMAIL PROTECTED]> wrote: > in my object_detail view i need to emit links to the previous and next > objects in the object list which invoked this detail view. has anyone > done this? any advice? If the objects are ordered by a DateField or DateTimeField, each one will have me

Re: Problem with generic views (404)

2007-09-16 Thread James Bennett
On 9/16/07, Florian Lindner <[EMAIL PROTECTED]> wrote: > {% if Abbreviation_list %} Read the generic views documentation carefully; the default variable name the view will give you is "object_list". -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~---

Re: caching and authentication

2007-09-16 Thread James Bennett
On 9/13/07, patrickk <[EMAIL PROTECTED]> wrote: > if 2 users are logged in, the username is displayed correctly for each > user. BUT: if a user is logged-out, his/her username is still > displayed. something doesn´t seem to work here and I can´t figure out > what´s wrong. If a user logs out, the

Re: Creating link to root

2007-09-16 Thread James Bennett
On 9/16/07, Florian Lindner <[EMAIL PROTECTED]> wrote: > This template is used within different paths. Therefore I need to have the > styles.css availabe in every path the template could be used. > An alternative would be give the entire URL href="http://xgm.de/styles.css. > But then I need to cha

Re: template inheritance and default text

2007-09-17 Thread James Bennett
On 9/17/07, bramble <[EMAIL PROTECTED]> wrote: > My base.html has this: > > {% block greeting %}not logged in{% endblock %} Personally, I wouldn't use the view for this; I'd do {% if user.is_authenticated %}Hello, {{ user.username }}{% else %}Not logged in{% endif %} If you must assign the

Re: Where can I find the templatetag called "humanize" in Django application components "django-registration "

2007-09-19 Thread James Bennett
On 9/19/07, beck917 <[EMAIL PROTECTED]> wrote: > Where can I find the templatetag called "humanize" in Django application > components "django-registration " By looking at Django's documentation: http://www.djangoproject.com/documentation/add_ons/#humanize I thought I might finally be safe remo

Re: django, flup, and googlebot

2007-09-20 Thread James Bennett
On 9/20/07, Darrin Thompson <[EMAIL PROTECTED]> wrote: > So I tried to be the bot and looked at what it would have seen: > > $ curl -s -I http://.com/HTTP/1.1 200 OK > Vary: Cookie > Content-Type: text/html; charset=utf-8 > Date: Thu, 20 Sep 2007 15:44:33 GMT > Server: lighttpd/1.4.13 > > I ca

Re: def __str__(self,):

2007-09-20 Thread James Bennett
On 9/20/07, Greg <[EMAIL PROTECTED]> wrote: > However, when I view this is the admin I get the following error: > '__str__ returned non-string (type float)'. Is there anyway to solve > this problem? Do I have to return a string? Yes. You *must* return a string, because the entire point of __str

Re: Django application using ORM only

2007-09-20 Thread James Bennett
On 9/20/07, Martin Taylor <[EMAIL PROTECTED]> wrote: > Any assistance with either of these items, including pointers to > examples and documentation, would be greatly appreciated. http://groups.google.com/group/django-users/search?group=django-users&q=standalone+orm&qt_g=Search+this+group (the s

Re: i18n/setlang no longer support GET

2007-09-21 Thread James Bennett
On 9/20/07, Arnold Chen <[EMAIL PROTECTED]> wrote: > I don't know why the developers change like that, and if there any one > can, please tell me the consequences of using GET (by modifying the > set_language function by myself) The HTTP specification says that GET requests should not take any ac

Re: can´t do django update: propfind request failed

2007-09-21 Thread James Bennett
On 9/21/07, patrickk <[EMAIL PROTECTED]> wrote: > when I do "svn update" within the django_src directory, I´m getting > this error: > svn: PROPFIND request failed on '/' > svn: PROPFIND of '/': 200 OK (http://code.djangoproject.com) It's working fine for me. Double-check that things are working o

Re: shemas evolution

2007-09-22 Thread James Bennett
On 9/22/07, Alexandre Forget <[EMAIL PROTECTED]> wrote: > I wonder what people are using *right now* to evolve their data ? ALTER TABLE. No, really ;) -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ You re

Re: shemas evolution

2007-09-23 Thread James Bennett
On 9/23/07, Alex Koshelev <[EMAIL PROTECTED]> wrote: > There is limited functionality for ALTER in sqlite Which is why I only use PostgreSQL. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ You received thi

Re: elsif in templates?

2007-09-24 Thread James Bennett
On 9/24/07, A. Reppel <[EMAIL PROTECTED]> wrote: > does the template language have a elsif clause for if and if{not}equal? No, just nest {% if %}, {% ifequal %}, etc., like so: {% if foo %} {{ foo }} {% else %} {% if bar %} {{ bar }} {% endif %} {% endif %} -- "Bureaucrat

Re: guid's in python

2007-09-25 Thread James Bennett
On 9/24/07, Leo Shklovskii <[EMAIL PROTECTED]> wrote: > I've been able to dig into this a little bit more and it looks like > django.utils.simplejson.decoder doesn't support the '\x' escape > character. Is this an intentional omission, a bug in Django, or just me > misunderstanding Python? JSON d

Re: django book out date

2007-09-25 Thread James Bennett
On 9/25/07, Jalil <[EMAIL PROTECTED]> wrote: > Anyone know when the django book is comming out ? I though it was suppose > to come out last month. > I am going outside the country and I would like to get my hands on this book > before leaving. The only people who would have reliable information

Re: It's Django for bussines/financial apps??

2007-09-26 Thread James Bennett
On 9/26/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > The question is: what do you think? can I use django for this? I think perhaps you should read the Django documentation; Django isn't a product that "can do" or "can't do" certain types of things, it's a set of libraries for you to use wh

Re: It's Django for bussines/financial apps??

2007-09-26 Thread James Bennett
On 9/26/07, ringemup <[EMAIL PROTECTED]> wrote: > One of the limitations of the Django ORM that I'd imagine would be a > big deal for financial reporting is that it doesn't have the best > support for grouping and aggregate functions. Is there any plan to > deal with that in the future? There ha

Re: Deployment issues: ViewDoesNotExist error

2007-09-26 Thread James Bennett
On 9/26/07, Steve Potter <[EMAIL PROTECTED]> wrote: > ViewDoesNotExist: Tried index in module projectsmt.imglog.views. Error > was: 'module' object has no attribute 'models' Something in your views module is trying to import from a 'models' module that either doesn't exist, or isn't where your im

Re: Deployment issues: ViewDoesNotExist error

2007-09-26 Thread James Bennett
On 9/26/07, Steve Potter <[EMAIL PROTECTED]> wrote: > user = models.ForeignKey(auth.models.User) > > It appears that the django.contrib.auth is missing the models > attribute. No, it's not. Most likely there's a bad import statement in your models file, or no import statement, or you've got two t

Re: Compiling views.py?

2007-09-27 Thread James Bennett
On 9/27/07, Prateek Parekh <[EMAIL PROTECTED]> wrote: > Also, i have recently enabled a couple of apps in the settings.py and > urls.py, but i haven't been able to access them in my website. Does > this also require a restart? Any change of any sort to any part of your code, other than HTML in a

Re: Downloadable HTML documentation?

2007-09-28 Thread James Bennett
On 9/28/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > A search of the group didn't turn this up, so I thought I'd ask: is > there any way to get an HTML version of the docs other than slurping > it off the Django site? The indexing and links in the HTML version is > quite useful. Not at the

Re: how to do something at startup

2007-09-28 Thread James Bennett
On 9/28/07, Mark Green <[EMAIL PROTECTED]> wrote: > i'm looking for a way to perform a bunch of initialization tasks > right after django startup. There really is no such thing as "Django startup"; remember that Django is hosted inside a web server, and that server processes will come and go over

Re: url of incoming request

2007-09-28 Thread James Bennett
On 9/28/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Does the request object contain any information about the referring > url? http://www.djangoproject.com/documentation/request_response/#attributes -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~

Re: Downloadable HTML documentation?

2007-09-28 Thread James Bennett
On 9/28/07, staff-gmail <[EMAIL PROTECTED]> wrote: > well, I have not tried it myself but it should all be in the SVN > respository for anyone to download, right ? The plain-text reST source documents are in the repository, but the HTML versions are generated dynamically and aren't currently avai

Re: Redirect after login problem

2007-09-29 Thread James Bennett
On 9/29/07, Paddy Joy <[EMAIL PROTECTED]> wrote: > views.py > @login_required(redirect_field_name='/login/') > def index(request) You're using the 'redirect_field_name' argument incorrectly. The default value is 'next', which means Django will expect something like this: http://yoursite.com/acc

Re: how to scale (was: how to do something at startup)

2007-09-30 Thread James Bennett
On 9/30/07, Mark Green <[EMAIL PROTECTED]> wrote: > Hm, this raises some serious scalabity questions for me. > >From your description it sounds like there is no template > fragment caching, not even db connection pooling possible > with django? You can cache anything you want to cache; read the c

Re: Downloadable HTML documentation?

2007-09-30 Thread James Bennett
On 9/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Given the age of that ticket, however, is the procedure that "requires > a bit of work" documented anywhere? Don't be put off by the ticket being old; for a while there really wasn't a suitable "champion" for the idea, and so not much hap

Re: how to scale (was: how to do something at startup)

2007-09-30 Thread James Bennett
On 9/30/07, Mark Green <[EMAIL PROTECTED]> wrote: > My question was really only about the former, a much simpler problem: > How to keep a tcp connection persistent and re-use it across requests? By using a pooling connection manager external to Django. Again, complicating the application layer wi

Re: how to scale (was: how to do something at startup)

2007-09-30 Thread James Bennett
On 9/30/07, Mark Green <[EMAIL PROTECTED]> wrote: > I'm not sure what drove me to call it "fragment caching". > What I really meant to point at are the little things (such as > form_for_model()) that would likely benefit from some object > caching instead of burning cycles for each request. You c

Re: unsubscribe

2007-09-30 Thread James Bennett
Instructions for unsubscribing are in the bottom of every message sent from this list: > A minor plea for those who are still subscribed: please don't pile on with responses. It's an easy mistake to make. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~

Re: Objects.get() need to limit 1 record

2007-10-01 Thread James Bennett
On 10/1/07, cschand <[EMAIL PROTECTED]> wrote: > Is there any way to limit to return only one data.. ? Yes. Read the Django database API documentation: http://www.djangoproject.com/documentation/db-api/ -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~---

Re: Should Django have a road map?

2007-10-01 Thread James Bennett
On 10/1/07, Stefan Matthias Aust <[EMAIL PROTECTED]> wrote: > There's no 0.97 version despites all that changes to SVN trunk for > months. Because we're not ready for a 0.97 release. The goals for the next release and the general run up to Django 1.0 are pretty well-known, even if they're not met

Re: mysql error

2007-10-01 Thread James Bennett
On 9/30/07, Jan Stavel <[EMAIL PROTECTED]> wrote: > InternalError at /admin/store/storeitem/ > (1, "Can't create/write to file > '/var/lib/mysql/tmp/#sql_2182_0.MYI' (Errcode: 2)") This is an error occurring internally in the MySQL database server, not an error in Django or in your code. -- "Bu

Re: Should Django have a road map?

2007-10-01 Thread James Bennett
On 10/1/07, Stefan Matthias Aust <[EMAIL PROTECTED]> wrote: > It might be very obvious to you what is missing before 0.97 can be > released because you're deeply involved with the development and > exactly know it. However, I cannot easily find the answer on the web > site. Searching the mailing a

Re: new user vs. logged out user

2007-10-02 Thread James Bennett
On 10/2/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I want to distinguish requests from people that have never had an > account from folks that just have an expired session. This really isn't possible; once their cookie expires, anything you "knew" about them disappears. You could set some

Re: Unhashed passwords and django.contrib.auth

2007-10-02 Thread James Bennett
On 10/2/07, Densetsu no Ero-sennin <[EMAIL PROTECTED]> wrote: > I need to store unhashed user passwords in the DB. Is it possible with > django.contrib.auth? User.set_password method uses SHA-1 and it cannot be > overridden easily. So don't use set_password(), and avoid any built-in views which t

Re: how to scale

2007-10-02 Thread James Bennett
On 10/2/07, Andrey Khavryuchenko <[EMAIL PROTECTED]> wrote: > Shouldn't it? In case of MySQL replication (which is quite widely used) > and transactions someone somehow *has* to decide where the whole > transaction is going - to a master or to a slave. In the case of MySQL, use MySQL Cluster, wh

Re: where to put algorithm libraries

2007-10-02 Thread James Bennett
On 10/2/07, staff-gmail <[EMAIL PROTECTED]> wrote: > I have a class full of algorithms - where is the best place to put this > in Django so that I can then just "import libxxx" in any model class. If they're logically part of the application, put them in the application. Nothing in Django prohibi

Re: clean_data or cleaned_data

2007-10-02 Thread James Bennett
On 10/2/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > so changed to slug=form.cleaned_data['slug'], it is ok now. > > why? If you are using the development version of Django, it is very much in your best interest to follow Django's development carefully; from time to time, backwards-incompat

Re: how to scale

2007-10-03 Thread James Bennett
On 10/3/07, Andrey Khavryuchenko <[EMAIL PROTECTED]> wrote: > The only thing django app should know is that there are two different > *kinds* of servers: read-only and whole access. It doesn't matter how many > servers you have - you may well have pool of masters and pool of slaves, it > doesn't

Re: Adding extra info to HttpResponseRedirect

2007-10-03 Thread James Bennett
On 10/3/07, Nabuco <[EMAIL PROTECTED]> wrote: > I have a view which receives a list of items in my app to be deleted. > After the deletion, I need to return a page containing the same origin > page plus a message like "the items (items here) have been > successfully deleted". http://www.djangopro

Re: confused over using ORM in view/template

2007-10-03 Thread James Bennett
On 10/3/07, staff-gmail <[EMAIL PROTECTED]> wrote: > So my question was how do I do ORM in a view ?? Where is "choice_set" > coming from ?? http://www.djangoproject.com/documentation/db-api/#backward -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~

Re: how to scale

2007-10-04 Thread James Bennett
On 10/4/07, Andrey Khavryuchenko <[EMAIL PROTECTED]> wrote: > JB> You mean no projects using MySQL Replication, > > Did I? I think I've said exactly opposite. You jumped from "MySQL Replication won't work" to "no big projects will use Django". Big projects already are using Django, therefore th

Re: filtering through django templates then through textile

2007-10-05 Thread James Bennett
On 10/5/07, kan <[EMAIL PROTECTED]> wrote: > Say I have a text file. Is it possible to treat the file as a django > template then filter through textile to finally get xhtml ? This has > the advantage that I can write my web pages in textile but also have > the facilities of django's if then tags

Re: Method calls in templates

2007-10-05 Thread James Bennett
On 10/5/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > The user can only call methods on the objects you pass to the template > via the context. So if you want to restrict what they can do, only pass > in objects that have the methods you want to permit. This is exactly why > this method of f

Re: Method calls in templates

2007-10-06 Thread James Bennett
On 10/6/07, Andreas Ahlenstorf <[EMAIL PROTECTED]> wrote: > Do you think about specific context processors or tags provided by > default with Django? Built-in tags I'm not so worried about, though there are some dangerous context processors (the 'request' and 'debug' processors, for example). But

Re: default = current user

2007-10-06 Thread James Bennett
On 10/6/07, Alessandro Ronchi <[EMAIL PROTECTED]> wrote: > Is it possible to set a field value as the current user in the admin panel? No. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ You received this m

Re: model self reference

2007-10-07 Thread James Bennett
On 10/7/07, Oleg Korsak <[EMAIL PROTECTED]> wrote: > hello! is it possible to do something like that?: > > class ModelClass(models.Model): > parent = models.ForeignKey(ModelClass,blank=True,null=True) Yes, and the exact technique you'll need is covered in the documentation. -- "Bureaucr

Re: Global Variables in Templates?

2007-10-08 Thread James Bennett
On 10/8/07, lars <[EMAIL PROTECTED]> wrote: > I can see why it is necessary to instantiate RequestContext with the > request object. But in terms of DRY I wonder wether there isn't a > better way? Sure, just write a short wrapper function which calls "render_to_response" and uses a RequestContext

Re: Regstration module "lost password"

2007-10-08 Thread James Bennett
On 10/8/07, onno <[EMAIL PROTECTED]> wrote: > My application lets users register. I'm using James Bennet > registration module. > But I wonder how to make a lost password page for a user that forgot > their password? Wich module do I use for that? In the default setup, the URL /accounts/password/

Re: Regstration module "lost password"

2007-10-08 Thread James Bennett
On 10/8/07, Bill Fenner <[EMAIL PROTECTED]> wrote: > Which is an excellent way to partially lock someone out of the site, > by preemptively changing their pasword (and emailing them the new > one). This operation should really email a challenge URL which, if > visited, leads to a "set new passwor

Re: Regstration module "lost password"

2007-10-09 Thread James Bennett
On 10/8/07, Marty Alchin <[EMAIL PROTECTED]> wrote: > His point is that anyone could trigger that email. And, while you're > right that only the true user would receive the email, the target > user's password will get reset regardless. So, if I didn't like you, I > could put in your email address,

Re: Regstration module "lost password"

2007-10-09 Thread James Bennett
On 10/9/07, Bill Fenner <[EMAIL PROTECTED]> wrote: > He alternative is to exchange a handshake before changing the > password. Don't jump immediately to "must store plain text > passwords". OK, so when you demonstrate to me that this is a significant and widespread enough problem to justify comp

Re: deseb installation in ubuntu

2007-10-09 Thread James Bennett
On 10/9/07, Xan <[EMAIL PROTECTED]> wrote: > Where is the error? In all seriousness, judging from your last several emails, it's time for you to sit down and read the official documentation for Python; most of your problems seem to stem from not understanding how Python's import path works. --

Re: How to set a global variable?

2007-10-09 Thread James Bennett
On 10/9/07, Greg <[EMAIL PROTECTED]> wrote: > I want to create a list that can be updated from within a part of a > view and retreived from another part of a view. Here is my view.py To access a global variable you need to use the 'global' keyword. A better option, however, is to store the resu

Re: Django-tagging weirdness (noob question)

2007-10-10 Thread James Bennett
On 10/9/07, coffeeho <[EMAIL PROTECTED]> wrote: > As a CharField, there's no problem. When I changed it to get the > sexier ManyToManyField it got weird. The tags appear and transfer > between fields (in admin view) and save in the link like they should, > but they do not appear in the tagging "ta

Re: Using Django's builtin documentation

2007-10-11 Thread James Bennett
On 10/11/07, Rufman <[EMAIL PROTECTED]> wrote: > Django uses docutils and restructured text for the documentation of > the admin. How can i get my own documentation of my views and models > (restructured text) to show on the documentation page in the django > admin (dashboard -> documentation)? I

Re: How to only show records that are less than 20 days old?

2007-10-11 Thread James Bennett
On 10/11/07, Greg <[EMAIL PROTECTED]> wrote: > I have a model called Style that contains a DateField. It stores the > date when the record was created. I want my template to only show > Style records that were created less than 20 days ago. I think that > this needs to be done within the view,

Re: saving to existing rows in a table

2007-10-12 Thread James Bennett
On 10/12/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I have a quick question about saving things. It's probably a rather > simple question but I didn't see how to do this in the documentation > anywhere but maybe I overlooked. http://www.djangoproject.com/documentation/models/many_to_many/

Re: Using Django's builtin documentation

2007-10-12 Thread James Bennett
On 10/12/07, Rufman <[EMAIL PROTECTED]> wrote: > I read somewhere, that django automatically creates the documentation > for the variables passed to a template. Is there some function i have > to activate or is this not possible? Django doesn't automatically generate _any_ documentation. All it d

Re: How to only show records that are less than 20 days old?

2007-10-12 Thread James Bennett
On 10/12/07, Greg <[EMAIL PROTECTED]> wrote: > I added 'from datetime import datetime' to my views.py and tried the > following code in one of my functions: 'assert False, > datetime.timedelta(days=20)' Read my post again *carefully*. (hint: "from datetime import datetime" was not in anything I

Re: django admin -> documentation -> views

2007-10-12 Thread James Bennett
On 10/12/07, lmierzej <[EMAIL PROTECTED]> wrote: > hi, I'm using django 0.96 > when I log into django admin, select documentation and then my views > (http://localhost:8000/admin/doc/views), > I can see that there is no information about my views (every view > contain only one link - Back to Views

Re: template variables

2007-10-12 Thread James Bennett
On 10/13/07, Goon <[EMAIL PROTECTED]> wrote: > can you use variables in django's templates? Yes. > and then something like > {% int x =3; x++ %} No. Django's template language is not Python or any other programming language. Its sole purpose is presentational logic. -- "Bureaucrat Conrad,

Re: template variables

2007-10-13 Thread James Bennett
On 10/13/07, Goon <[EMAIL PROTECTED]> wrote: > fair enough, I'm not happy that I can't get {{for x in y[1:5]}} Perhaps the documentation will make you happy: http://www.djangoproject.com/documentation/templates/#slice -- "Bureaucrat Conrad, you are technically correct -- the best kind of corre

Re: {% spaceless %} doesn't work?

2007-10-14 Thread James Bennett
On 10/14/07, Andrew <[EMAIL PROTECTED]> wrote: > So why does http://dpaste.com/22430/ turn into http://dpaste.com/22431/ > ? Quoth the documentation: "Only space between tags is removed — not space between tags and text." -- "Bureaucrat Conrad, you are technically correct -- the best kind of c

Re: How to define urls

2007-10-16 Thread James Bennett
On 10/16/07, Pythoni <[EMAIL PROTECTED]> wrote: > Thanks a lot for help.It works well for , e.g. John Smith > but what if a user inserts John.Smith ( period instead of space)? > I tried to add a period This is the point where you really want to pause and read Python's regular-expression docume

Re: Relating model to itself.

2007-10-16 Thread James Bennett
On 10/16/07, Dmitriy Sodrianov <[EMAIL PROTECTED]> wrote: > As it can be seen from the code above, i want some tasks to have > parent, and a parent must be a task too. The Django documentation covers this. http://www.djangoproject.com/documentation/model-api/#many-to-one-relationships http://www

Re: python mvc framework and java mvc framework

2007-10-19 Thread James Bennett
On 10/19/07, Laszlo Marai <[EMAIL PROTECTED]> wrote: > So the java solutions need more configuration work but they might be more > flexible in some cases. And don't forget that you're comparing a set of > components (java) against a full stack (django). The configuration work > can be alleviated b

Re: Markdown problem

2007-10-21 Thread James Bennett
On 10/21/07, Alexander Tsamutali <[EMAIL PROTECTED]> wrote: > No one helped, and I almost forgot about this post. Another solution > emerged unexpectedly when I installed my site on the server. I found > this problem when i used python-markdown version 1.6b. Our server had > version 1.4 and it wor

Re: Newbie error: sqlite3.OperationalError: unable to open database file

2007-10-21 Thread James Bennett
On 10/21/07, SSK <[EMAIL PROTECTED]> wrote: > Hmm. Changing ~/... to /Users/Myname/... solved the problem. Django does not expand shell abbreviations or variables, like "~" or "$HOME", when opening files. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-

Re: AP-style state names

2007-10-23 Thread James Bennett
On 10/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I just know this has got to be lurking around in Django somewhere... > If I use USStateField, is there a filter or other method to output the > state name in Associated Press style? I know there's AP filters for > times and numbers, but c

Re: Can't set request.method = 'POST'

2007-10-27 Thread James Bennett
On 10/27/07, Greg <[EMAIL PROTECTED]> wrote: > I have some links on my site. I don't want to wrap these links around > a form element. Is there anyway that I can send post data without > using a form? You need to start by reading this: http://faqs.org/rfcs/rfc2616.html -- "Bureaucrat Conrad,

Re: problem with request.GET.getlist['choices']

2007-10-29 Thread James Bennett
On 10/29/07, faypy <[EMAIL PROTECTED]> wrote: > sending forms checkbox values as choices , > but none of these works : > > request.POST.getlist['choices'] > request.GET.getlist['choices'] Perhaps you should pause to work through a Python tutorial. -- "Bureaucrat Conrad, you are technically corr

Re: Detecting changed fields when saving an object

2007-10-30 Thread James Bennett
On 10/30/07, Ben <[EMAIL PROTECTED]> wrote: > I'm trying to create an audit trail for a particular model, capturing > all changes made on the objects. You might want to read this: http://code.djangoproject.com/wiki/AuditTrail -- "Bureaucrat Conrad, you are technically correct -- the best kind

Re: "No fixtures found" error in tutorial

2007-10-31 Thread James Bennett
On 10/31/07, rhett <[EMAIL PROTECTED]> wrote: > Loading 'initial_data' fixtures... > No fixtures found. This is not an error. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ You received this message becaus

Re: keeping SECRET_KEY secret

2007-11-01 Thread James Bennett
On 11/1/07, Carl Karsten <[EMAIL PROTECTED]> wrote: > > Given that some settings.py files get shared/posted/uploaded to code.google, > etc. it seems this should not be in there by default: > > # Make this unique, and don't share it with anybody. > SECRET_KEY = 'foo!' By the same token, then, the

Re: keeping SECRET_KEY secret

2007-11-01 Thread James Bennett
On 11/1/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > View the whole settings file as something you don't just release > casually and then only post the bits you feel safe doing so. That is > absolutely normal configuration file practice. Apologies if I wasn't as clear as I could have been;

Re: keeping SECRET_KEY secret

2007-11-01 Thread James Bennett
On 11/1/07, Carl Karsten <[EMAIL PROTECTED]> wrote: > The generated settings.py contains things that are perfectly normal "source > code" like things that should be treated as such. How does one only commit > part > of a file to svn? Why do you need to commit your project's settings file to a p

Re: keeping SECRET_KEY secret

2007-11-02 Thread James Bennett
On 11/2/07, Ned Batchelder <[EMAIL PROTECTED]> wrote: > Sometimes, when a topic comes up over and over, it means something is > wrong. Maybe not the original decision; it could be the documentation, or > the perception of the user base, or whatever. I understand the need to not > revisit old de

Re: encoding problem in instance signal / dispatcher?

2007-11-03 Thread James Bennett
On 11/3/07, omat <[EMAIL PROTECTED]> wrote: > sbj = u'new tag: %s' % (instance.name) You might want to read this: http://code.djangoproject.com/wiki/UnicodeBranch#PortingApplicationsTheQuickChecklist There's a warning about using this style of string interpolation under Python 2.3 which may

Re: form submission -> @login_required -> get form submission data

2007-11-03 Thread James Bennett
On 11/2/07, crybaby <[EMAIL PROTECTED]> wrote: > I want to display the form even when the user is not logged in, but > want to allow them to do form submission. So when they post the data, > @login_required decorator is called on one of the view functions. Now > user logs in and I want the earli

Re: Admin logout fails in r6447

2007-11-04 Thread James Bennett
On 11/4/07, Dokter Bob <[EMAIL PROTECTED]> wrote: > My bad - it turned out there was a non-existent view listed in our > url's. > Somehow this caused the admin logout to not work (and some other > strange problems too). I suspect the reason for this is that the admin now uses the 'url' template t

Re: streaming status

2007-11-04 Thread James Bennett
On 11/4/07, Karen Tracey <[EMAIL PROTECTED]> wrote: > No. The only way to send stuff to a browser is to respond to an HTTP > request, so if you want the browser to see regular status updates you'll > have to set it up so that the browser makes periodic requests for status. > I've never used this

Re: streaming status

2007-11-04 Thread James Bennett
On 11/4/07, Karen Tracey <[EMAIL PROTECTED]> wrote: > Ah, not something I'm familiar with. Yet more to learn Wikipedia has a decent write-up of the core idea: http://en.wikipedia.org/wiki/Comet_(programming) Most of the backing for this sort of thing has come from the Dojo folks. -- "Bur

Re: spam

2007-11-06 Thread James Bennett
On Nov 6, 2007 11:47 AM, Derek Anderson <[EMAIL PROTECTED]> wrote: > ok, seriously, is there not something we can do about the porn spam? > some of us read this list at work on machine's we don't own. the image > stuff is becoming a serious problem. About all you can do is mark it as spam and le

Re: spam

2007-11-06 Thread James Bennett
On Nov 6, 2007 1:22 PM, Michael Best <[EMAIL PROTECTED]> wrote: > This is one of the few lists where I get spam in my gmail account at > all. I don't know why that is, it almost feels like there is no > filtering on the list by Google at all. I'm subscribed to a number of Google Groups-based lis

Re: Best Django Blogs

2007-11-06 Thread James Bennett
On Nov 6, 2007 4:32 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > What are the best django blogs, can you guys tell me. Thanks Are you looking for blogs which write about Django (and thus which you'd want to read), or blog software written with Django? -- "Bureaucrat Conrad, you are techni

Re: will this hit database more than once by using AUTH_PROFILE_MODULE = 'myuser.MyUser'

2007-11-06 Thread James Bennett
On Nov 5, 2007 9:00 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > i have a topic want to discuss with all: > there is a option in django-registration : AUTH_PROFILE_MODULE = > 'myuser.MyUser' which can be setted in settings.py, so you can access > value of MyUser by get_profile.xxx. This i

Re: pull a random record from the database

2007-11-09 Thread James Bennett
On Nov 9, 2007 12:44 PM, Hani <[EMAIL PROTECTED]> wrote: > What I would like to do is create a method to the model, say > random_id, so that object.random_id will access a random instance. I'm not trying to be mean, but what you should do is read Django's database API documentation, which explain

Re: pull a random record from the database

2007-11-09 Thread James Bennett
On Nov 9, 2007 1:00 PM, Hani <[EMAIL PROTECTED]> wrote: > I did go through the API documentation but did not find what I wanted. > Please note that I am both a Django and Python newbie so its likely I > did not 'get it'. Would you direct me to the pertinent topic/heading/ > paragraph? http://www.

Re: admin-interface - 500 error - missing MEDIA_URL

2007-11-09 Thread James Bennett
On Nov 9, 2007 1:29 PM, Brot <[EMAIL PROTECTED]> wrote: > does this mean, that there is no solution for this problem or is there > a smart workaround? This means there is absolutely nothing in Django which will, in the server error view, attempt to run your context processors. There is not a swit

Re: admin-interface - 500 error - missing MEDIA_URL

2007-11-09 Thread James Bennett
On Nov 9, 2007 12:49 PM, Marty Alchin <[EMAIL PROTECTED]> wrote: > I seem to remember something a while back about 500 not processing too > much, to reduce the possibility of getting into a recursive loop of > exceptions. I can't seem to find that now, but that could be what > we're running into.

Re: Using auth in model

2007-11-09 Thread James Bennett
On Nov 9, 2007 8:18 PM, Arnold Chen <[EMAIL PROTECTED]> wrote: > Sorry, there is a typo mistake, my question is "how to get logged-in" > user WITHOUT request parameter. > Because i want to use it in a function in models.py This is not possible. The logged-in user is an attribute of an HTTP reques

Re: pull a random record from the database

2007-11-09 Thread James Bennett
On Nov 9, 2007 10:32 PM, Hani <[EMAIL PROTECTED]> wrote: > What I want to do is display 1 random book on the main page. I > currently use a generic view to display a list of books on the main > page but I also want a random book highlighted. (imagine two columns > on the main page, one is the list

Re: Will there be a django 0.97 release ?

2007-11-10 Thread James Bennett
On Nov 10, 2007 8:36 AM, David Reynolds <[EMAIL PROTECTED]> wrote: > Is this going to coincide with the release of the django book, by any > chance? ;) The book is not, never has been and never will be tied in any way to the timing of a 1.0 release. The book's schedule has always been independent

Re: Will there be a django 0.97 release ?

2007-11-10 Thread James Bennett
On Nov 10, 2007 10:01 PM, ToddG <[EMAIL PROTECTED]> wrote: > I don't think (at least hope) that people in general are slighting the > amount of effort that goes into a release -- a big recurring theme > seems to be though that what you keep graciously going to great > lengths to repeat here isn't

Re: User Authentication and Models

2007-11-11 Thread James Bennett
On Nov 11, 2007 3:57 AM, Patrick Ohearn <[EMAIL PROTECTED]> wrote: > I have tried adding the following lines to by models.py. > > author = models.ForeignKey(User) > author = models.ForeignKey(django.contrib.auth.models.User) > > Both to no avail, thank you for your help so far :) In orde

Re: Not Required Field

2007-11-11 Thread James Bennett
On 11/11/07, Ronaldo Z. Afonso <[EMAIL PROTECTED]> wrote: > I'd like to know how I set a field of a Model to be not required when > someone is inserting data in the model using the admin interface? The documentation on creating models covers this: http://www.djangoproject.com/documentation/model

<    5   6   7   8   9   10   11   12   13   14   >