Re: auto urls for methods

2008-08-21 Thread James Bennett
On Thu, Aug 21, 2008 at 4:51 AM, Will Rocisky <[EMAIL PROTECTED]> wrote: > Is it possible (like Rails) to not to enter every method and it's url > everytime? And url should go to the method straight unless defined. No. 1. Python's general philosophy is that it's best to explicitly say what you

Re: Reverse URL Questions

2008-08-21 Thread James Bennett
On Thu, Aug 21, 2008 at 1:50 AM, Rodney Topor <[EMAIL PROTECTED]> wrote: > So: Why is the use of explicit URLs discouraged, especially in > templates? Why is it better to write {% url > project_name.app_name.views.results %} in a template than to write / > results/ (assuming the URLconf maps

Re: how to display date nicely

2008-08-18 Thread James Bennett
2008/8/18 Will Rocisky <[EMAIL PROTECTED]>: > actually I have to do it in views, not template > I need some pure python code All Python datetime objects support the 'strftime' method, which is what you want to use. Consult Python's documentation for the full details. -- "Bureaucrat Conrad,

Re: Making a Form from a model using ModelForms, but dont want to include the ForeignKey variable in the form

2008-07-21 Thread James Bennett
On Mon, Jul 21, 2008 at 4:09 PM, Django_newbie <[EMAIL PROTECTED]> wrote: > This save() fails because the form.is_valid() is not true, and the > Blog(foreignkey) field is missing from the post data, how can i make > this save without letting user choose this blog field? Or is it > necessary that

Re: autodiscover() fails too silently...

2008-07-21 Thread James Bennett
On Mon, Jul 21, 2008 at 4:12 PM, Amit Ramon <[EMAIL PROTECTED]> wrote: > autodiscover() goes over INSTALLED_APPS and tries to import their admin > modules. When such a module isn't present, ImportError is caught and > consumed. However, if some admin module do exists, but for some reason it >

Re: Is Django development active?

2008-07-20 Thread James Bennett
On Sun, Jul 20, 2008 at 6:57 AM, Hussein B <[EMAIL PROTECTED]> wrote: > I got that illusion due the slow official releases cycle... Be careful with this logic, because it is misleading. For example: Britain has not had a new Prime Minister since June 2007; does this mean the British Government

Re: Django vs. Kohana

2008-07-17 Thread James Bennett
On Wed, Jul 16, 2008 at 6:05 PM, Henrik Bechmann <[EMAIL PROTECTED]> wrote: > Can anyone with experience or knowledge of both Django and Kohana (PHP > framework, son of CodeIgniter) list contexts in which each would be > most appropriate? I'm in a selection process right now with both on > the

Re: Where is the source code for Practical Django Projects?

2008-07-17 Thread James Bennett
On Thu, Jul 17, 2008 at 2:14 AM, Phillip Parrin <[EMAIL PROTECTED]> wrote: > I'm also looking for the souce code, mainly i'm looking for the > advanced templates you mention when building the weblog. Did you get > the chance to finish the source? I'm tracking down one other reported issue which

Re: Where is the source code for Practical Django Projects?

2008-07-09 Thread James Bennett
On Wed, Jul 9, 2008 at 3:33 AM, Evan H. Carmi <[EMAIL PROTECTED]> wrote: > I am reading Practical Django Projects but am unable to find the online > source code. Does anyone know where this is located? I would think that > it would be at http://www.apress.com/book/view/1590599969. However, that >

Re: not allowing me to login to admin site

2008-07-08 Thread James Bennett
On Tue, Jul 8, 2008 at 4:33 AM, allisongardner <[EMAIL PROTECTED]> wrote: > Will look further into problem as it does not accept any of my user > logins that have been created by the admin site, even though I know i > am using the correct username and password. I do have shell access as > I am

Re: Create field from two others

2008-07-03 Thread James Bennett
On Thu, Jul 3, 2008 at 8:59 PM, lukeqsee <[EMAIL PROTECTED]> wrote: > > Can you take a first_name & a last_name field and then in the same > model make a field that is full_name? ie > first_name = models.CharField(max_length=75) > last_name = models.CharField(max_length=75) > full_name =

Re: Using SQLite in production

2008-07-03 Thread James Bennett
On Thu, Jul 3, 2008 at 8:28 PM, Alex Slesarev <[EMAIL PROTECTED]> wrote: > One more issue - if you change a model, then you have to drop database > and recreate it using syncdb (sqlite do not allow modifying tables and > columns). It is not so good for production use. This is not quite correct.

Re: django+mod_python, caching or something else?

2008-07-02 Thread James Bennett
On Wed, Jul 2, 2008 at 7:09 AM, Alex Koshelev <[EMAIL PROTECTED]> wrote: > Client-side caching. Use the `never_cache` decorator No, that's not it at all. > On Jul 2, 3:43 pm, Mario <[EMAIL PROTECTED]> wrote: >> I look at sql log - django didn't query that, but always query lists, >> for

Re: template via email

2008-07-01 Thread James Bennett
On Tue, Jul 1, 2008 at 8:37 PM, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Look at the render_to_string() method for converting templates to > strings: > http://www.djangoproject.com/documentation/templates_python/#the-render-to-string-shortcut And if you end up using a template to generate

Re: help request using python_twitter api with django and errno 25

2008-06-27 Thread James Bennett
On Fri, Jun 27, 2008 at 11:02 PM, Hani <[EMAIL PROTECTED]> wrote: > My questions are: > 1. can anyone explain the error a little better to me? > 2. Is it a bug in the python-twitter api, or in django, or in my code? > 3. Is there a fix that does not involve using the patch? > 4. If I have to use

Re: Need help including a queryset in every view

2008-06-27 Thread James Bennett
On Fri, Jun 27, 2008 at 4:27 PM, Brandon Taylor <[EMAIL PROTECTED]> wrote: > What's the best way to go about this? Obviously I don't want to have > to pass the queryset into the context of every action, in every view > across the entire site :) Same way you make anything accessible to lots of

Re: psycopg2

2008-06-27 Thread James Bennett
On Fri, Jun 27, 2008 at 6:19 AM, Will <[EMAIL PROTECTED]> wrote: > Ah, sorry. Reading the Django book had led me to believe I was stuck > with psycopg: The change which allows user-defined backends to be plugged in happened after the 0.96 release, so the book is accurate for 0.96. --

Re: psycopg2

2008-06-27 Thread James Bennett
On Fri, Jun 27, 2008 at 3:06 AM, Will <[EMAIL PROTECTED]> wrote: > Would I have to write an entire new backend for postgres, just to use > a different driver? You'd need a module that implements the interface of a Django database adapter while using another driver. A few months ago I saw an

Re: django naming conventions ?

2008-06-25 Thread James Bennett
On Wed, Jun 25, 2008 at 5:02 PM, PFL <[EMAIL PROTECTED]> wrote: > I have done some searching but could not find a set of standard naming > conventions that is recommended for Django objects: There's really not much that's Django-specific; as with most Python code, the recommendation is to follow

Re: Hooking up Users and Profiles

2008-06-24 Thread James Bennett
On Tue, Jun 24, 2008 at 2:53 PM, radioflyer <[EMAIL PROTECTED]> wrote: > I continue to struggle with what I see as some real limitations of the > User/UserProfile paradigm used by Django. Well, it doesn't cover every conceivable thing you might want to do, which is to be expected; out of the

Re: psycopg2

2008-06-24 Thread James Bennett
On Tue, Jun 24, 2008 at 12:20 PM, Will <[EMAIL PROTECTED]> wrote: > I really didn't want to turn this into a fight, and I apologise if my > posts have seemed inflammatory. I'd just like to be able to trust all > my stack. Well, this is the thing: are you going to this level of detail on *every*

Re: psycopg2

2008-06-24 Thread James Bennett
On Tue, Jun 24, 2008 at 11:28 AM, Will <[EMAIL PROTECTED]> wrote: > All I'm asking for is some reason to trust the integrity of psycopg, > and all I'm getting from you is sarcasm. Perhaps you could provide me > with some links? psycopg is used, happily, by everyone from hobbyists to Fortune 500

Re: Extending the method that is called the first time a model is deployed.

2008-06-22 Thread James Bennett
On Sun, Jun 22, 2008 at 4:41 AM, mwebs <[EMAIL PROTECTED]> wrote: > It seems as if these signals have to be used in management.py, but > what I need is something I can use directly in my model code. > Something like overloading a method. The fact that this should be > happen in the model-class is

Re: get_models

2008-06-19 Thread James Bennett
On Thu, Jun 19, 2008 at 9:11 PM, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > This is just one of those areas that we haven't got around to > documenting yet. It doesn't mean we don't want to document this > feature - it just means other things have taken priority. We're always > open to

Re: get_models

2008-06-19 Thread James Bennett
On Thu, Jun 19, 2008 at 8:01 PM, Marty Alchin <[EMAIL PROTECTED]> wrote: > In fact, I'm confident enough that they're not going anywhere that I'm > in the process of documenting them on dead trees. I already beat you to it, at least partially (got some uses of get_model() in my book). --

Re: get_models

2008-06-19 Thread James Bennett
On Thu, Jun 19, 2008 at 7:02 PM, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > Short version: See also long version: http://www.b-list.org/weblog/2007/nov/03/working-models/ If these functions were to change, Django itself would need to undergo not-insignificant refactoring. And since such a

Re: Freelance Django Developers Urgently Needed

2008-06-17 Thread James Bennett
Hey, there, django-users subscribers! This is your periodic friendly reminder that the place for job listings is http://djangogigs.com/, which exists specifically to serve that purpose. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct."

Re: Use new variables on templates

2008-06-15 Thread James Bennett
On Sun, Jun 15, 2008 at 11:29 AM, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: > One of the things django does for you is make 'settings' available > everywhere. So if you want to use these constants in a template, you > should be able to do this in a view: Er. No, no it doesn't. If you want

Re: problem with forms with db access

2008-06-15 Thread James Bennett
On Sun, Jun 15, 2008 at 7:58 AM, ./ed <[EMAIL PROTECTED]> wrote: > the problem is that when i add an entry to the aModel table it does > not update in the form (even with various reload scheme) > it does update when I 'touch' the python file. So my guess is the > problem lies in the 'compilation'

Re: simple python math help.

2008-06-15 Thread James Bennett
On Sun, Jun 15, 2008 at 4:36 AM, Jarred Bishop <[EMAIL PROTECTED]> wrote: > it returns '0'. which isnt much help. how do i get '0.5' or '.5' ? This has a very long history, going all the way back to the C programming language (which the Python interpreter is written in, and which many

Re: Disconnected ORM objects

2008-06-13 Thread James Bennett
On Fri, Jun 13, 2008 at 11:01 PM, Karish <[EMAIL PROTECTED]> wrote: > I want to be able to use my ORM objects (eg, EmailMessage, > EmailAddress) in some cases without a database. For example, I want to > write a function like download_email_messages that will download email > messages and return

Re: Extending User model with model inheritance?

2008-06-13 Thread James Bennett
On Fri, Jun 13, 2008 at 10:54 PM, meppum <[EMAIL PROTECTED]> wrote: > With the query refactoring branch being merged to the trunk I wanted > to finally move some of the data I had put on my user profiles to a > derrived user model. I didn't see this mentioned in the documentation > and I wanted

Re: Roadmap to 1.0 and internationalization in db

2008-06-13 Thread James Bennett
On Fri, Jun 13, 2008 at 5:38 PM, Adrián Ribao <[EMAIL PROTECTED]> wrote: > I think I can make this work in three weeks, If I do, could it be > considered for Django 1.0? Since it appears that it wouldn't introduce any backwards-incompatible changes, I'd be against putting it on a 1.0 timeline;

Re: django-registration with my custom user profile

2008-06-13 Thread James Bennett
2008/6/13 Chr1s <[EMAIL PROTECTED]>: > But still I don't know how to implement this, anyone could give me a > simple example? thanks very much This feature is intended for a situation where each of the following is true: 1. You have a custom user-profile model. 2. The user-profile model has

Re: Django Tutorial Clarification

2008-06-13 Thread James Bennett
On Fri, Jun 13, 2008 at 2:24 AM, wave connexion(BQ) <[EMAIL PROTECTED]> wrote: > Does this mean Django generated API code for you? No. The phrase "no code generation necessary" means precisely what it says: that, unlike some frameworks which require you to run a script which generates files of

Re: SQLobject vs SQLAlchemy

2008-06-13 Thread James Bennett
On Fri, Jun 13, 2008 at 1:15 AM, Pepsi330ml <[EMAIL PROTECTED]> wrote: > i shall go read more about SqlObject then. If you're planning to use Django, and if you do not already have a very strong attachment to another ORM, consider just using the one that comes with Django. It will make your life

Re: Painfully slow... why?

2008-06-10 Thread James Bennett
On Tue, Jun 10, 2008 at 7:42 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > At the risk of talking to myself, I may have found the cause of my > slowdowns: KeepAlive. Setting it OFF has -- so far -- made a HUGE > performance improvement. More than I saw from memcached, or anything > I've done

Re: "more than 1 ForeignKey" error in newforms-admin

2008-06-09 Thread James Bennett
On Mon, Jun 9, 2008 at 2:08 PM, Andre Meyer <[EMAIL PROTECTED]> wrote: > i have a model with a class that has a foreign key and a subclass that has > another. this works well for creating the database, but the admin does not > like it. I believe your problem is that support for hierarchies of

Re: Django Suitable for this?

2008-06-08 Thread James Bennett
On Sun, Jun 8, 2008 at 1:05 AM, beetlecube <[EMAIL PROTECTED]> wrote: > I read a blog entry somewhere by someone contemplating the ideal type > of web application needs that Django best meets: Since it was > written originally for publishing articles in a newspaper environment, > it's good for

Re: I need outsourcing

2008-06-06 Thread James Bennett
Once again: Please route job listings to djangogigs.com. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: django programming project

2008-06-06 Thread James Bennett
On Fri, Jun 6, 2008 at 7:55 PM, david.watson <[EMAIL PROTECTED]> wrote: > I have a relatively simple django project that I need to get done. > I'm an experienced software engineer, but I don't have the cycles to > do this myself. I have, however, carefully thought out the > requirements and

Re: ORM question

2008-06-06 Thread James Bennett
On Fri, Jun 6, 2008 at 6:57 PM, Dan W. <[EMAIL PROTECTED]> wrote: > I'm pretty new to django and so far so good except for one thing. When I > fetch model objects, their related objects are showing up as RelatedManager > and ManyRelatedManager objects intead of the types I created and modified in

Re: Caching question

2008-06-06 Thread James Bennett
On Fri, Jun 6, 2008 at 2:11 PM, Peter Rowell <[EMAIL PROTECTED]> wrote: > I'm a little confused. The docs (http://www.djangoproject.com/ > documentation/middleware/#django-middleware-cache-cachemiddleware) > say, and the code appears to support it, that if >

Re: Caching question

2008-06-05 Thread James Bennett
On Thu, Jun 5, 2008 at 3:05 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I've read the caching documentation several times, but must be missing > some fine points. If I have > CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True > set, does per-view or template fragment caching override that? If you

Re: Can Someone Do something about ALL THIS SPAM

2008-06-05 Thread James Bennett
Guys, this has been covered before, multiple times. But once more, with feeling: * The list is run through Google Groups, so Google's spam filtering is what's applied. * The way to train Google's spam filter is to use their spam-reporting mechanism. * The alternative to this is to start

Re: why so slow?

2008-06-03 Thread James Bennett
On Tue, Jun 3, 2008 at 4:00 PM, <[EMAIL PROTECTED]> wrote: > im running part 2 of the tutorial right now and im inside the admin. > when connecting to localhost it is s slow, why? If you need to have a running dialogue with someone who can help you as you walk through the tutorial, consider

Re: django + google appengine?

2008-06-03 Thread James Bennett
On Tue, Jun 3, 2008 at 4:02 PM, <[EMAIL PROTECTED]> wrote: > google appengine seems like a good place to start, then i dont have to > get my own servers and stuff. > > is this easy integrateable? or doesnt google appengine and django work > together? There are a number of articles and tutorials

Re: why do i have to add this to Apache?

2008-06-03 Thread James Bennett
On Tue, Jun 3, 2008 at 2:17 PM, <[EMAIL PROTECTED]> wrote: > why is this necessary? do i have to do this for every project? > testproject.settings implies i do. You probably want to research how mod_python works in order to understand what the configuration directives are and which ones are

Re: auto admin for production

2008-06-03 Thread James Bennett
On Tue, Jun 3, 2008 at 11:54 AM, pihentagy <[EMAIL PROTECTED]> wrote: >> Currently the admin interface doesn't handle row-level permissions. A >> user can be granted to edit articles, but not restricted to only their >> own. I *believe* this is a feature that will be added in newforms-admin. > >

Re: "Includes" directory?

2008-06-02 Thread James Bennett
On Mon, Jun 2, 2008 at 1:29 PM, Huuuze <[EMAIL PROTECTED]> wrote: > I'm new to Django, so please be gentle. Basic question: when > developing a web app, I've typically created an "includes" directory > which stores commonly used functions or methods. From a best practice > standpoint, is it

Re: How to import ModelForm Dynamically?

2008-06-02 Thread James Bennett
On Mon, Jun 2, 2008 at 9:06 AM, David.D <[EMAIL PROTECTED]> wrote: > views.py > == > def model_form(request, model_name): >form_class = __import__('products.models.%sForm'%model_name) >form = form_class() >... > > model_name is a string Unless you really grok how __import__()

Re: Method .cache() for QuerySet

2008-06-02 Thread James Bennett
On Mon, Jun 2, 2008 at 11:58 AM, Marinho Brandao <[EMAIL PROTECTED]> wrote: > Meanwhile, I am not sure if it is safe as I need, so, I wish to know > your opinion about it: Review of patches proposed for Django should take place in the Django ticket tracker; djangosnippets is not the appropriate

Re: How nicely does django play in a distributed environment?

2008-06-02 Thread James Bennett
On Mon, Jun 2, 2008 at 7:06 AM, Phillip B Oldham <[EMAIL PROTECTED]> wrote: > I'm looking at using django to replace our current CMS application > written in PHP. Currently we have two servers behind a load balancer, > and everything's nice and stable. We're getting a consistent month-on- > month

Re: local import or not for django apps?

2008-05-30 Thread James Bennett
On Thu, May 29, 2008 at 4:06 PM, Milan Andric <[EMAIL PROTECTED]> wrote: > Anyone happen to have a strong opinion on this? Should django > applications use local imports or package based imports? Sorry if > this has been mulled over a million times. Applications should expect to live on the

Re: Django and Comma-Formatting Numbers

2008-05-29 Thread James Bennett
On Thu, May 29, 2008 at 1:15 PM, David <[EMAIL PROTECTED]> wrote: > I had need of commas in floating-point numbers, and slightly modified > humanize.py with a floatcomma function: > > def floatcomma(value): >""" >Converts a float to a string containing commas every three digits. >For

Re: may be BUG. SyntaxError: non-keyword arg after keyword arg

2008-05-28 Thread James Bennett
On Wed, May 28, 2008 at 4:32 AM, sector119 <[EMAIL PROTECTED]> wrote: > Is it a bug, or I misunderstood something in filter usage? It looks like you have stray whitespace or line breaks in the middle of things which should be continuous text. This would, naturally, lead to strange behavior. For

Re: hanging os.system() when doing pdf generation

2008-05-27 Thread James Bennett
On Tue, May 27, 2008 at 11:05 AM, Milan Andric <[EMAIL PROTECTED]> wrote: > Worked just fine from the interpreter but I noticed some stuff being > returned on stdout (same as on cmd line). So I added the --quiet > option to htmldoc and now it seems fine and returns 0 in the > interpreter. Maybe

Re: How to Implement "Most Viewed"?

2008-05-25 Thread James Bennett
On Sun, May 25, 2008 at 9:08 PM, jonknee <[EMAIL PROTECTED]> wrote: > Unless you cache the view. Just update it once an hour/day. You still have to record the raw number of hits somewhere. Doing this in the database, in real time, is often not possible because it does lead to one write per page

Re: Avoiding code duplication with many similar models

2008-05-25 Thread James Bennett
On Sun, May 25, 2008 at 10:13 PM, Trevor Caira <[EMAIL PROTECTED]> wrote: > So while it is possible to do this with model inheritence, at least > the most obvious solution involves a lot of code duplication. A situation like this is often an indicator that you haven't sufficiently abstracted

Re: Authenticated user from models.py

2008-05-21 Thread James Bennett
On Wed, May 21, 2008 at 8:23 PM, Patrick J. Anderson <[EMAIL PROTECTED]> wrote: > Passing a Request object should work in application views, but what if > one wants to capture that information on every save() call, including in > the admin? > > What would be an elegant and beautiful approach to

Re: Reusable models?

2008-05-21 Thread James Bennett
On Wed, May 21, 2008 at 12:29 PM, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote: > One use case could be, for example, > the Institution model with title and description fields in project A, > then the Institution model with title, description, and address fields > in project B, > and then the

Re: Authentication for whole app

2008-05-20 Thread James Bennett
On Tue, May 20, 2008 at 8:57 PM, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > Let me ask my own question then. If one is running multiple Django > instances, does Django provide anything that would help with single > sign on (SSO) across all the distinct Django application instances? Well, they

Re: Authentication for whole app

2008-05-20 Thread James Bennett
On Tue, May 20, 2008 at 7:14 PM, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > If you want to use HTTP Basic authentication, then put everything > under/behind Apache and use Apache to do it. If you want to use form > based authentication with same user database across all applications > gets a

Re: user.is_authenticated is always false using default login

2008-05-20 Thread James Bennett
On Tue, May 20, 2008 at 10:32 AM, Andrew English <[EMAIL PROTECTED]> wrote: > Do I need to explicitly call authenticate and login in my own view to > populate the user data? From what I read, it seems that the > django.contrib.auth.views.login does that automatically. There's a difference

Re: "request"object within models.py

2008-05-19 Thread James Bennett
On Mon, May 19, 2008 at 4:10 PM, Tim Chase <[EMAIL PROTECTED]> wrote: > It's the last bit that can throw folks...many folks seem to use > very nice/helpful bits of the framework that abstract the save() > call so it's never thought-about. Wouldn't adding a parameter to > save() stymie the admin

Re: "request"object within models.py

2008-05-19 Thread James Bennett
On Mon, May 19, 2008 at 3:45 PM, Richard Dahl <[EMAIL PROTECTED]> wrote: > how do you pass the request object to models? Same way you pass any argument to any function or method in Python: write your function/method to accept the argument, and pass it from the code that calls the

Re: "request"object within models.py

2008-05-19 Thread James Bennett
On Mon, May 19, 2008 at 3:24 PM, enri57ar <[EMAIL PROTECTED]> wrote: > How access to request object within models ? Pass it as an argument the same as any other value. Magical hacks to try to make it available otherwise are likely to land you in trouble later on. -- "Bureaucrat Conrad, you

Re: Django experts wanted

2008-05-19 Thread James Bennett
On Mon, May 19, 2008 at 10:56 AM, Jim R. Wilson <[EMAIL PROTECTED]> wrote: > I am compiling a contact list of Django experts who may be interested > in opportunities under the right circumstances. I am not a recruiter > - I'm a regular developer who sometimes gets asked for referrals when > I'm

Re: Printing out HTML that doesn't get converted to

2008-05-19 Thread James Bennett
On Mon, May 19, 2008 at 12:51 AM, Tomás Garzón Hervás <[EMAIL PROTECTED]> wrote: > I think, you use the {% autoescape off %} text to escape {% endautoescape %} > Search more information of autoescape en django documentation Turning autoescaping on and off for large sections of a template is a

Re: Legacy Databases - custom filter?

2008-05-18 Thread James Bennett
On Sun, May 18, 2008 at 4:10 PM, Dougal <[EMAIL PROTECTED]> wrote: > How would I then do this SQL manually? I know writing SQL is to be > avoided but is there an easy way to execute SQL commands? Writing SQL is *not* to be avoided. Using an ORM is basically a trade-off, where some things are

Re: how to avoid uploading .py source files to shared hosting server

2008-05-16 Thread James Bennett
On Fri, May 16, 2008 at 11:52 AM, ydjango <[EMAIL PROTECTED]> wrote: > I do not want to make it easy for some one who breaks in , either a > outsider or may be an rougue hosting provider employee or contractor, > to easily get access to all the information - data and code. Again: if this is your

Re: how to avoid uploading .py source files to shared hosting server

2008-05-16 Thread James Bennett
On Fri, May 16, 2008 at 9:15 AM, ydjango <[EMAIL PROTECTED]> wrote: > Yes, that was another thing on my mind, how to encrypt password in > settings.py You don't. I think either you misunderstand how shared hosting works, or you have an extremely bad host. -- "Bureaucrat Conrad, you are

Re: how to avoid uploading .py source files to shared hosting server

2008-05-16 Thread James Bennett
On Fri, May 16, 2008 at 5:02 AM, ydjango <[EMAIL PROTECTED]> wrote: > I have propriety commercial code and some formula/ algo > implementations which I do not want to expose. > Hence I do not want to upload .py source files If your host's setup would allow other users to view this code, you have

Re: IntegerField - SQL type changed?

2008-05-15 Thread James Bennett
On Thu, May 15, 2008 at 5:34 AM, Amit Ramon <[EMAIL PROTECTED]> wrote: > Was there any change in django in the recent months that could explain this? > Namely, could it be that a couple of months ago django would indeed generate > a varchar(20) for this field, and now it generates int(11)?

ANNOUNCE: Security bugfix releases

2008-05-13 Thread James Bennett
In accordance with our security policy[1], a set of releases is being issued tonight to fix a security vulnerability reported to the Django project. This message contains a description of the vulnerability, a description of the changes made to fix it, pointers to the the relevant patches for each

Re: Handle on request object from custom tag

2008-05-09 Thread James Bennett
On Fri, May 9, 2008 at 10:11 PM, Greg Fuller <[EMAIL PROTECTED]> wrote: > How do I get a handle on the request object from within a custom > template tag? By making the request available to the template as a context variable, then accessing it the same as any other context variable. --

Re: Group by for querysets

2008-05-09 Thread James Bennett
On Fri, May 9, 2008 at 12:47 PM, Chris <[EMAIL PROTECTED]> wrote: > Does django carry something similar to what I am looking for? If not, > would a group_by feature be something worth adding to django? If you're using a recent Django trunk checkout (after the queryset-refactor merge), there is

Re: /admin Cross-Site Scripting (XSS) issue!

2008-05-07 Thread James Bennett
On Wed, May 7, 2008 at 3:18 PM, Richard Dahl <[EMAIL PROTECTED]> wrote: > If I said that this condition is indicative of an XSS attack vector I > may as well say that Apache is vulnerable to a Denial of Service > attack because 'after I ran apachectl stop, I could no longer get to > my

Re: /admin Cross-Site Scripting (XSS) issue!

2008-05-07 Thread James Bennett
Also, for future reference, please remember that if you think you've found a security problem in Django the correct action is to send email to [EMAIL PROTECTED] -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct."

Re: /admin Cross-Site Scripting (XSS) issue!

2008-05-07 Thread James Bennett
On Wed, May 7, 2008 at 2:51 PM, Richard Dahl <[EMAIL PROTECTED]> wrote: > Excellent, good catch, when logged out it does indeed display the > alert, I image it has to do with the 'next' property, which is not, I > believe, escaped, as it is not entered into the DB or presented to any > other

Re: /admin Cross-Site Scripting (XSS) issue!

2008-05-07 Thread James Bennett
On Wed, May 7, 2008 at 1:45 PM, mw <[EMAIL PROTECTED]> wrote: > It worked for me and I have one of the fairly recent copies from SVN. > (not like today up to date, but pretty up to date) Visiting the precise URL he pasted, in current Django trunk (SVN revision 7514), I get a 404. And I can't

Re: Django equivilent of PHP date in templates.

2008-05-07 Thread James Bennett
On Wed, May 7, 2008 at 2:06 PM, DuncanM <[EMAIL PROTECTED]> wrote: > Would I have to create a template tag, or is there anyway of just > sticking it straight into the template? > > Something similar to what the following php returns: > date("F j, Y"); You probably want to read the list of

Re: /admin Cross-Site Scripting (XSS) issue!

2008-05-07 Thread James Bennett
On Wed, May 7, 2008 at 12:31 PM, Chunlei Wu <[EMAIL PROTECTED]> wrote: > /admin/index.php/%22%3E%3Cscript%3Ealert%283939%29%3C/script%3E/ > > I am surprised the passed javascript code is indeed executed. Can > somebody verify that? Is it a big threat? Which version of Django is this happening

Re: child edit causes duplication with model inheritance

2008-05-04 Thread James Bennett
On Sun, May 4, 2008 at 3:29 AM, bobhaugen <[EMAIL PROTECTED]> wrote: > Does that mean newforms-admin includes qs-ref? That is, newforms- > admin includes all of the most current svn trunk? The ideal way to find out this sort of information is to watch the development timeline:

Re: child edit causes duplication with model inheritance

2008-05-04 Thread James Bennett
On Sun, May 4, 2008 at 12:58 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > if you add an "A" object then edit it and hit save it duplicates > itself. Does anyone else have this trouble with model inheritance? The admin does not currently support model inheritance. This is a known and

Re: django-tagging doesn't work with qs-ref

2008-05-02 Thread James Bennett
On Fri, May 2, 2008 at 1:05 PM, bcurtu <[EMAIL PROTECTED]> wrote: > How can I solve this parse_lookup problem? > Cheers Have you considered looking at that project's bug tracker? http://code.google.com/p/django-tagging/issues/detail?id=106=1=queryset-refactor -- "Bureaucrat Conrad, you are

Re: HEAD requests causing AttributeError

2008-05-01 Thread James Bennett
On Thu, May 1, 2008 at 4:39 AM, omat <[EMAIL PROTECTED]> wrote: > I don't see why someone / something is hitting with HEAD requests. Can > it be a security issue? No, it's not a security issue. It probably means you've enabled the middleware view-documentation middleware

Re: persistence of variable in views.py

2008-05-01 Thread James Bennett
On Thu, May 1, 2008 at 1:23 AM, skunkwerk <[EMAIL PROTECTED]> wrote: > I have a variable defined by a function call in my views.py that's at > the global level at the start of the file (ie is not inside any other > function, though the variable is not prefixed by 'global'). As this > takes a

Re: Backwards incompatibility with fancy PostgreSQL queries and QS-RF

2008-04-30 Thread James Bennett
On Wed, Apr 30, 2008 at 11:43 PM, Barry Pederson <[EMAIL PROTECTED]> wrote: > any thoughts on the best way to do this now with QS-RF? Well, the official database API docs say [1]: "In some rare cases, you might wish to pass parameters to the SQL fragments in extra(select=...)`. For this

Re: Django on Jython - anybody doing it?

2008-04-30 Thread James Bennett
On Wed, Apr 30, 2008 at 9:44 PM, rich <[EMAIL PROTECTED]> wrote: > More out of curiosity than anything else, is anybody using Django on > Jython? Several people are, and are actively involved in improving both Jython and Django to work better together; a number of bugs have been reported to

Re: Queryset-refactor branch has been merged into trunk

2008-04-28 Thread James Bennett
On Mon, Apr 28, 2008 at 8:32 AM, Juanjo Conti <[EMAIL PROTECTED]> wrote: > Could you give me a url where new features are explained? > Is this backwards compatible or should I svn up with care? Well, there's the wiki page Malcolm linked up in his original post... -- "Bureaucrat Conrad, you

Re: Odd Multi Select Behavior

2008-04-27 Thread James Bennett
On Sun, Apr 27, 2008 at 1:39 PM, Alex Ezell <[EMAIL PROTECTED]> wrote: > but if I log the value of "request.POST['point_list']" I see this: > > 37​.​4482804​,-​122​.​12251 > > It's like it doesn't know that it's a list. This makes it problematic > to do anything with the values in

Re: Updating django forms makes me...

2008-04-27 Thread James Bennett
On Sun, Apr 27, 2008 at 10:28 AM, notfound <[EMAIL PROTECTED]> wrote: > What could be the reason here that it sometimes works, sometimes does not? Multiple server processes; each one has its own copy of the code, and refreshes independently. -- "Bureaucrat Conrad, you are technically correct

Re: SUM on a model

2008-04-27 Thread James Bennett
On Sun, Apr 27, 2008 at 8:47 AM, Darryl Ross <[EMAIL PROTECTED]> wrote: > I use: > >total = sum([obj.amount for obj in Model.objects.all()]) As of the merge of qsrf, this will also work: total = sum(Model.objects.values_list('amount', flat=True)) Plus there's the SoC project which

Re: Updating django forms makes me...

2008-04-27 Thread James Bennett
On Sun, Apr 27, 2008 at 7:17 AM, notfound <[EMAIL PROTECTED]> wrote: > No, that's a hosted server, I don't have access to Apache > unfortunately. Is there any other way I could make it reload the code? Not really, no. In a production deployment, the code stays resident in memory for the life

Re: Disabling autoescaping when calling render_to_string

2008-04-26 Thread James Bennett
On Sat, Apr 26, 2008 at 9:38 PM, Darryl Ross <[EMAIL PROTECTED]> wrote: > So my question is, is there an argument which will disable auto-escaping? > If not, would there be some merit to adding some functionality that allows > this, either as an argument or perhaps to make the auto-escaping only

Re: 'dict' object has no attribute 'autoescape'

2008-04-23 Thread James Bennett
On Wed, Apr 23, 2008 at 6:59 PM, falcon <[EMAIL PROTECTED]> wrote: > 94. if (context.autoescape and not isinstance(output, > SafeData)) or isinstance(output, EscapeData): Right there's your problem. you've ended up passing a plain dictionary someplace where Django was expecting you to

Re: how do designers create content

2008-04-20 Thread James Bennett
On Sun, Apr 20, 2008 at 1:33 AM, lee <[EMAIL PROTECTED]> wrote: > designers. Do the designers use text base editting like ultraedit or > or graphics based software like dreamweaver? Most of the artist I know > don't do much coding and are into photoshop, illustrator and > dreamweaver. Most

Re: mail in base64

2008-04-17 Thread James Bennett
On Thu, Apr 17, 2008 at 10:16 PM, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > (1) What version of Django are you using (the mail infrastructure has > changed a bit between 0.96 and trunk, from memory)? He was using Django 0.96, and running into this (fixed on trunk) issue:

Re: Enterprise applications with Django

2008-04-16 Thread James Bennett
On Wed, Apr 16, 2008 at 8:05 AM, Hussein B <[EMAIL PROTECTED]> wrote: > Is it possible to create enterprise applications (in the same context > of Java EE applications, highly concurrent, distributed ...) with > Python? Google seems to manage it... -- "Bureaucrat Conrad, you are

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