Re: How to server static media secured by Django authentication

2009-11-20 Thread Glenn Tenney
At 11:49 PM -0600 9/11/09, Gabriel Gunderson wrote: >On Fri, Sep 11, 2009 at 3:03 PM, Jim Myers wrote: >> I have a requirement to serve static files only to users authenticated >> through Django secure login. > >http://docs.djangoproject.com/en/dev/howto/apache-auth/ I've

Re: Django meetup in San Francisco this Thursday?

2006-12-18 Thread Glenn Tenney
re you talking about being in SF proper, or "in the Bay Area"? Whenever / wherever you decide, please let us know... maybe one or both of us will be able to make it. -- Glenn Tenney --~--~-~--~~~---~--~~ You received this message because you are subscrib

Re: Off Topic: Mac software for database design?

2006-08-04 Thread Glenn Tenney
On 4 Aug 2006, at 19:35, Joseph Heck wrote: > I believe it was a little custom script that generated a schema > model in OmniGraffle from the ruby code. Not 100% sure, but I > recall seeing one of the local ruby guys using it. Back in April I posted here: Subject: pictorial representation

Re: Django source editing offtopic

2006-08-01 Thread Glenn Tenney
On Tue, Aug 01, 2006 at 04:29:02PM -0700, Joseph Heck wrote: > On the Mac, I used TextWrangler Yep, very nice... But I mostly just use emacs (which comes with Mac OS X, as well as "vi" if you're so inclined). -- Glenn --~--~-~--~~~---~--~~ You received this

Re: mod_python autoreload acts unpredictable

2006-07-07 Thread Glenn Tenney
tested code over to a QA group who would test it again (a different level of testing) on a staging server, and then finally the QA group would move the fully tested code over to the production server. -- Glenn Tenney CISSP CISM --~--~-~--~~~---~--~~ You received this

Re: after_acreate after_change

2006-07-03 Thread Glenn Tenney
On Tue, Jul 04, 2006 at 10:10:55AM +1000, Malcolm Tredinnick wrote: > I can't see any real advantage in this. As Ivan shows, it's only a > couple of lines of code anyway (and a more or less documented feature). > The boolean test for "not created" at the moment is "if not self.pk:", > which seems

Re: after_acreate after_change

2006-07-03 Thread Glenn Tenney
On Mon, Jul 03, 2006 at 07:09:35AM -0500, James Bennett wrote: > You can also differentiate between the initial save and later updates > by checking -- before calling the parent class' 'save' method -- > whether the object has an ID; if it doesn't, then the object is being > created for the first

Re: Repetitive background tasks

2006-06-26 Thread Glenn Tenney
o your application will do the repetitive task once each interval. -- Glenn Tenney CISSP CISM --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-u

Re: null=True conditionally

2006-05-21 Thread Glenn Tenney
2) with ESMTP id k4L6Ga02010261 for <django-users@googlegroups.com>; Sat, 20 May 2006 23:16:36 -0700 Received: (from [EMAIL PROTECTED]) by zardoz.think.org (8.12.3/8.12.3/Debian-7.2) id k4L6GaSK010259 for django-users@googlegroups.com; Sat, 20 May 2006 23:16:36 -0700 Date: Sat,

Re: Install woes: error "python: can't open file 'django-admin.py' "

2006-05-05 Thread Glenn Tenney
On Fri, May 05, 2006 at 06:23:48PM -, jbrewer wrote: > But when I used DarwinPorts of SQLite it installed Python 2.4 here: > > /opt/local/bin - and located here also is sqlite3 Remember, I said to look at ALL of the comments from http://www.djangoproject.com/documentation/install/ which

Re: create models from the admin page?

2006-05-05 Thread Glenn Tenney
On Fri, May 05, 2006 at 12:20:35PM -0500, James Bennett wrote: > Keep in mind that's a wiki that *anyone* can contribute to, not just > "official" developers ;) And... because it's a wiki... have their contributions deleted too. (mine were) -- Glenn

Re: Install woes: error "python: can't open file 'django-admin.py' "

2006-05-04 Thread Glenn Tenney
On Fri, May 05, 2006 at 12:32:23AM -, jbrewer wrote: > I have tried to install the MySQLdb and keep getting this error: > > error: command 'gcc' failed with exit status 1 1. Read http://www.djangoproject.com/documentation/install/ 2. Follow all of the comments talking about Mac OS X

Re: Three models linked together: how do i do (...) ?

2006-05-04 Thread Glenn Tenney
On Thu, May 04, 2006 at 10:32:59PM +0200, Moi Meme wrote: > And on my particular ticket system case, Paul Bissex's 20 mn trouble > ticket system (http://e-scribe.com/news/230) looks cool, but is limited > to one model, which takes its list of applications from a static list > (INSTALLED_APPS).

Re: get parameters in template

2006-05-04 Thread Glenn Tenney
rt, "view":view, "display":display, "obj_list":obj_list, }, None) Then, in your template you refer to these variables just like {{ sort }} Hope that helps even though it's not generic views... -- Glenn Tenney --~--~-

Re: got unexpected keyword argument

2006-04-29 Thread Glenn Tenney
On Sat, Apr 29, 2006 at 08:20:30PM -0500, James Bennett wrote: > In the tutorial, the field on the Choice model ('poll') is the same as > the name of the model it's being related to ('poll'), which is why it > looks that way. Whenever they're different, you want to use the name > of the field on

Re: BooleanField and MySQL default value

2006-04-23 Thread Glenn Tenney
On Sun, Apr 23, 2006 at 03:14:15PM -0500, Adrian Holovaty wrote: > Default values aren't created at the SQL level -- they're enforced at > the Django DB-API level. I thought that was only enforced by the admin functionality and that if I wanted a default value for my views I'd have to write it

Re: Passing variables to include? (and New call tag)

2006-04-21 Thread Glenn Tenney
do: {% set title "title1" %} {% include some.html %} This would allow one template to pass lists, or objects within lists or whatever to other included templates. It's not as "elegant" as passing arguments to templates as what limodou has done, but it will get that job done

pictorial representation of models?

2006-04-14 Thread Glenn Tenney
In my reading up on Ruby on Rails, I found a link to a page on the RoR wiki that shows a pictorial representation of a schema (model) along with documentation etc. See http://wiki.rubyonrails.org/rails/pages/AccessControlListExample/versions/25 Does anything like that exist to take a Django

Re: Django vs Rails

2006-04-14 Thread Glenn Tenney
On Thu, Apr 13, 2006 at 07:17:16PM -0700, [EMAIL PROTECTED] wrote: > There is only one Rails book that is in print at the moment(non pdf). > There are several others that are going to be released very soon > though. http://www.robsanheim.com/2006/03/23/ruby-and-ruby-on-rails-book-roundup/ is a

Re: Ecommerce & Django

2006-04-14 Thread Glenn Tenney
A group with which I volunteer is a Cold Fusion shop. One of the other volunteers used EZ-Cart for a few ecommerce sites and loved it. You might want to see the features it has... See http://www.cf-ezcart.com/ -- Glenn --~--~-~--~~~---~--~~ You received this

Django vs Rails

2006-04-12 Thread Glenn Tenney
Several friends have been pushing me to look at Rails, so I've been reading through "Agile Web Development with Rails". Some quick thoughts... with a couple of questions thrown in... 1. Ok, there IS the Ruby vs Python thing... I'll leave that to some *other* place for THAT flame fest as I do

Re: Using _pre_delete() to stop execution

2006-04-11 Thread Glenn Tenney
On Tue, Apr 11, 2006 at 04:16:09PM -0400, Max Battcher wrote: > "pass" is the Python "do nothing" command, which is often used as an > indicator to "fill in the blanks" with your own specific code (because > Python doesn't allow empty functions it is often seen in psuedo-code). yes... yes... I

Re: Using _pre_delete() to stop execution

2006-04-11 Thread Glenn Tenney
On Tue, Apr 11, 2006 at 06:19:49PM -, arthur debert wrote: > the thing is, if there's anything in django's knowledge to avoid the > save / delete it DOES raise an error. (such as trying to delete an non > existant object or trying to save a model that does not pass > validation). my guess

Re: Using _pre_delete() to stop execution

2006-04-11 Thread Glenn Tenney
On Tue, Apr 11, 2006 at 02:24:04PM -0400, Max Battcher wrote: > You are free to raise your own exception in the path that fails to > call super().delete() in M-R. Then perhaps the docs etc. should instead show "raise " instead of "pass"... When one shows as an example to use "pass", it

Re: Overthinking urls.py?

2006-03-30 Thread Glenn Tenney
On Thu, Mar 30, 2006 at 03:07:01PM -0500, Max Battcher wrote: > I hate to say it, but Routes and most of the other schemes presented > _do_ feel over-engineered. The current URL patterns system is fast > and clean. The get_absolute_url() pattern is simple one, and yes it > might break the

Re: Overthinking urls.py?

2006-03-28 Thread Glenn Tenney
On Tue, Mar 28, 2006 at 08:44:48PM +0200, Arthur wrote: > That's similar to what I do. The get_absolute_url() concatenates a > _BASE_URL from settings.py or from the top of models.py with > what you call get_id_for_url. This isn't completely clean but easy to > change if you remember where to

Re: Overthinking urls.py?

2006-03-28 Thread Glenn Tenney
On Tue, Mar 28, 2006 at 12:19:39PM -0600, Jacob Kaplan-Moss wrote: > "correct" and just as simple, and each time I've failed. As far as > I'm concerned, if someone can come up with a way to do this that's > stupidly simple then I'm all for a change, but at the same time >

Re: ASCII or PDF version of docs?

2006-03-28 Thread Glenn Tenney
is fine, but the docs as part of the base tar file of Django must include all the docs -- and that must include the example docs too. ---OR--- the docs need to be rewriten to bring the documentation aspects of all the examples into the "docs" anothe

Re: Overthinking urls.py?

2006-03-27 Thread Glenn Tenney
On Mon, Mar 27, 2006 at 04:21:09PM -0600, Adrian Holovaty wrote: > The convention is to put the URL-creation logic in your models, in a > get_absolute_url() method. Here's a quick example: > ... > You're right to imply that this goes against the DRY principle, > because you have to define URLs in

Re: Recursive(?) ManyToMany model

2006-03-27 Thread Glenn Tenney
On Mon, Mar 27, 2006 at 12:37:54PM -0800, wam wrote: > Well, it was my understanding that since I have the potential of having > many 'inspired by' documents linked to a particular document, and that > any particular document could have inspired many other other documents, > then that means I'm

Re: Form field

2006-03-25 Thread Glenn Tenney
on of user input ***MUST*** always be done on the server-side and not JUST in the html code / javascript at the browser!! -- Glenn Tenney --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

Re: magick-removal: Suggestion

2006-03-20 Thread Glenn Tenney
sense, that happen to map onto tables and columns, rather than as columns and tables that happen to map onto field names. -- Glenn Tenney --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To po

Re: How to get vote total in poll tutorial

2006-03-18 Thread Glenn Tenney
On Fri, Mar 17, 2006 at 10:57:14PM -0800, [EMAIL PROTECTED] wrote: > No, one underscore doesn't work: > choices.get_values(fields=['poll', 'votes'], poll_id=1) > returns > TypeError: got unexpected keyword argument 'poll_id' > > I'm using two underscores because that's my (limited)

Question about _pre_save

2006-03-12 Thread Glenn Tenney
I had wanted to make up a unique field combining some other field and, ideally, an autoincrementing number unique to this class... I'd love to make this the primarykey, but I can't make up a SlugField as the primary key and another field to be the autoincrementing number because AutoField is

subclass calling parent's _pre_save?

2006-03-12 Thread Glenn Tenney
I found that a subclass' _pre_save method superceeds it's parent's and I have a situation where I need it to do something in addition to what it's parent does. e.g. class One(model): def _pre_save: ...something... class Two(One): def _pre_save: ? Based on Python

__repr__ and {% debug %}

2006-03-10 Thread Glenn Tenney
As part of developing my first Django app I'd make use of {% debug %} often to see what's happening. I spent a while yesterday trying to figure out why, just inserting a debug line in my template caused a traceback of a rendering exception. Turns out that I mistakenly had created a class with a

another template question

2006-03-10 Thread Glenn Tenney
In my first Django app I've got the following "rough" model (not real code, but enough to show what I mean): class Rateable some stuff common to all "Rateable" objects class Rating who = ForeignKey(User) what = ForeignKey(Rateable) values = ... class

Re: why is my view for a submitted form not getting a POST?

2006-03-09 Thread Glenn Tenney
On Thu, Mar 09, 2006 at 11:21:38PM +0800, limodou wrote: > Please check this document http://code.djangoproject.com/wiki/NewbieMistakes > It seems that you lost a '/' after action name "rated". Whoa! Thanks!!!That did it! I never even thought of that because my url pattern had a "rated/$"

templates invoking methods that need an argument?

2006-03-07 Thread Glenn Tenney
Some sample code excerpts, before my question: (this code is incomplete, but should give the idea of where I'm headed) class Rateable(meta.Model): value = meta.IntegerField() def current_rating(self): try: r = self.get_ratee_list() except: return "None"

Re: thoughts about adding a user rating

2006-03-03 Thread Glenn Tenney
On Fri, Mar 03, 2006 at 04:50:37PM -0600, James Bennett wrote: > If it were an up-or-down, the ratings fields probably wouldn't be > PositiveSmallintegerFields, and the comments module's > get_rating_options method probably wouldn't use a 1-10 rating scale as > the example in its docstring ;)

Re: thoughts about adding a user rating

2006-03-03 Thread Glenn Tenney
On Fri, Mar 03, 2006 at 03:02:32PM -0600, James Bennett wrote: > Take a look at the comments app distributed with Django > (django.contrib.comments), which has a rating system built in to it. Thanks, but it seems to me that it does a user voting (one up, or one down) rather than "I give this a 3

thoughts about adding a user rating

2006-03-03 Thread Glenn Tenney
ted on how to structure the models and views-code for this. Thanks -- Glenn Tenney --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroup

Re: db_api with a table with multiple relations

2006-03-01 Thread Glenn Tenney
On Thu, Mar 02, 2006 at 10:03:52AM +0800, Russell Keith-Magee wrote: > a.reporter_id = r2.id Wow, thanks! As I said, I had tried "... = r2.id" but that didn't work. I never would have thought of "a.reporter_id" since in the code to create it it uses "reporter=...". Do you know if in the M-R

Re: db_api with a table with multiple relations

2006-02-27 Thread Glenn Tenney
On Mon, Feb 27, 2006 at 10:24:33AM -0800, hsitz wrote: > Glenn -- I think your one to many answer is here: > http://www.djangoproject.com/documentation/models/many_to_one/ I knew how to add a record with a many_to_one, but for when I needed to change that relation afterwards, my testing showed

Re: db_api with a table with multiple relations

2006-02-27 Thread Glenn Tenney
At 6:22 PM -0800 2/26/06, hsitz wrote: >Have you taken a look at the Many-to-many relationships example? Looks >like you're trying to manually create the links between tables, whereas >you're supposed to use the Model API's built-in 'set_x' method. >

Re: Template IF statement with <,>,<=,>= (or equvalent)

2006-02-27 Thread Glenn Tenney
d yet, hasn't happened yet but will happen sometime this month / quarter / year, happened already this month/quarter/year. That sounds like a view criteria to me... What approach would you suggest taking in a case like the one I've just described above? Thanks. -- Glenn Tenney --~--~-

Naming conventions in docs / tutorials

2006-02-25 Thread Glenn Tenney
be crystal clear in documentation. Equally, I would find "APP_LABEL_MYPROJECT/MODULE_NAME_POLLS_get" to also work, but not be as crystal clear. -- Glenn Tenney --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Django versions

2006-02-25 Thread Glenn Tenney
e pre-m-r ... so starting from scratch with the m-r means a lot more headaches in learning Django. -- Glenn Tenney --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to thi

Re: generic views - object_detail and info_dict

2006-02-21 Thread Glenn Tenney
On Tue, Feb 21, 2006 at 09:22:25PM -, Jan Rademaker wrote: > The 'archive_day' you see in urlpatterns is the name of the view, eg. > django.views.generic.date_based.archive_day and not some string that's > appended to the module's name. Thanks... for some reason, I had the perception that