Re: model inheritance without a new database table

2009-02-24 Thread Malcolm Tredinnick
On Wed, 2009-02-25 at 16:06 +1100, Ryan Kelly wrote: [...] > > The use-case for the pure-Python inheritance that has been floating > > around is the case when you want to, say, use a different User manager > > in your own views. You don't want to change the auth app's behaviour in, > > say, admin,

Prepopulate username in login form

2009-02-24 Thread Ross Dakin
Would anyone else be interested in this? http://dpaste.com/hold/1272/ Ross --~--~-~--~~~---~--~~ 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@googlegroups.com To

Re: model inheritance without a new database table

2009-02-24 Thread Ryan Kelly
> Oh, okay. Yeah, that's quite different. I'm not convinced that should go > into Django. Again, there's a consistency thing: we present the object / > class type that is asked for, not some transparently descended version. I think my explanation may have been a bit off... > The use-case for the

Re: model inheritance without a new database table

2009-02-24 Thread Malcolm Tredinnick
On Wed, 2009-02-25 at 15:12 +1100, Ryan Kelly wrote: > > > If I'm feeling inspired tomorrow, I might try to formulate similar logic > > > as a patch to the ModelBase metaclass, so that subclasses that don't add > > > any fields will get pure-python inheritance by default. > > > > That (changing t

Re: model inheritance without a new database table

2009-02-24 Thread Ryan Kelly
> > If I'm feeling inspired tomorrow, I might try to formulate similar logic > > as a patch to the ModelBase metaclass, so that subclasses that don't add > > any fields will get pure-python inheritance by default. > > That (changing the default behaviour) would be a bad idea. The > implicit prima

Re: verbose_name in admin history function

2009-02-24 Thread Malcolm Tredinnick
On Tue, 2009-02-24 at 15:59 -0800, ralfthewise wrote: > anyone know why in the tutorial (http://docs.djangoproject.com/en/dev/ > intro/tutorial02/#intro-tutorial02) it claims when you view the > history of changes made to a model object in the admin interface, the > text of the message will use th

verbose_name in admin history function

2009-02-24 Thread ralfthewise
anyone know why in the tutorial (http://docs.djangoproject.com/en/dev/ intro/tutorial02/#intro-tutorial02) it claims when you view the history of changes made to a model object in the admin interface, the text of the message will use the fields "verbose_name" rather than the column name, but on a

Re: Securely storing passwords

2009-02-24 Thread Malcolm Tredinnick
On Tue, 2009-02-24 at 07:01 -0800, Mark Jones wrote: > How about integrating with something like OpenID? Not sure if it > would do the trick, but it might be a step in the right direction, > assuming the sites you are interoperating with are 'friendly' OAuth is the more appropriate tool in this

Re: Sessions with different expiry dates

2009-02-24 Thread Malcolm Tredinnick
On Tue, 2009-02-24 at 11:36 -0800, ggates03 wrote: > Is there any way to have multiple sessions for one browser? > Basically > I have a need for different cookie values to expire at different > times. There are some values I want to expire with the browser > session, however there are other valu

Re: select_related() and reverse foreign keys -OR- how to I get a blog post and its comments?

2009-02-24 Thread Malcolm Tredinnick
On Tue, 2009-02-24 at 11:34 -0500, Sean Patrick Hogan wrote: > Thanks for the input! So, I'm assuming by "easiest case" you mean > just calling LEFT OUTER JOINs. That's Rails behavior and then it > deals with it in Ruby. I'm not too familiar with SQLAlchemy, but it > looks like that's what they

Re: Dealing with multiple M2Ms

2009-02-24 Thread Malcolm Tredinnick
On Tue, 2009-02-24 at 07:13 -0800, jgen...@jimmy.harvard.edu wrote: > Hi there ... > > Suppose I have three Models: > > Model A > > Model B, has a M2M with Model A > > Model C, has M2Ms with both Model A and Model B > > What I'm trying to do is to construct a query which will answer the > fol

Re: model inheritance without a new database table

2009-02-24 Thread Malcolm Tredinnick
On Tue, 2009-02-24 at 22:38 +1100, Ryan Kelly wrote: > > > is there a way to have a model subclass avoid the creation of a > > > new database table,and just take its data straight out of the table for > > > its superclass? > > > > Right now, I suspect you would also have to manually set Meta.db

middleware or signals for sqlalchemy Session

2009-02-24 Thread davidlmontgom...@gmail.com
I would like to know if there is a consensus on the best way to set up and remove sqlalchemy Session's in django. I figure I'm either going to use middleware, something like this thread: http://groups.google.com/group/django-users/browse_thread/thread/e6749f7eec1cc46c/ef9d9e27943af830 or I'm goi

Re: Caching db connections

2009-02-24 Thread Malcolm Tredinnick
On Mon, 2009-02-23 at 20:23 -0800, A B wrote: > I need to use a db backend (Sybase) which is not supported by Django. > I don't need to use the Django ORM but would like Django to maintain a > pool of open db connections so that I don't have to make a new > connection every time I need to run a qu

InlineModelAdmin objects question

2009-02-24 Thread Kevin Coyner
I am using the Auth system in django and have a separate app People that I'm using to keep more detailed info (i.e. address, phone, etc) on my users. I presume from my docs reading that this is the best way. Question: Can I use InlineModelAdmin to handle new user input from just onepage, prefer

Re: Securely storing passwords

2009-02-24 Thread Eric Chamberlain
On Feb 24, 2009, at 3:49 AM, LaundroMat wrote: > > Hi - > > I'm working on a small django app that allows users to interact with > other websites where they have an account. Ofcourse, using this app > means providing your username and password for the other website. > > What are the most secure

Photologue and Galleriffic (JQuery plugin)

2009-02-24 Thread zegerman
Hi, I would love to use photologue in combination with galleriffic. But I have my problems creating a fitting template for it and changing the urls.py of photologue. I basically need one template for the galleries, with - a left navigation of all available gallery - the photo_thumbnail_url of al

post_save handler during test-fixture load is causing me grief

2009-02-24 Thread Matt Brown
I have models A and B, with B having an FK(null=False) to A. If I create a new instance of A, I have a post_save handler that potentially creates instances of B that point to the new A object. This works fine under normal circumstances, but when I'm loading a test fixture and this handler gets t

Re: seg fault with LDAP authentication

2009-02-24 Thread molhacker
After a lot of banging my head against a wall I finally figured this one out. If figured I'd post the solution in case someone else runs into the same problem. I found the solution when I googled this http://www.mail-archive.com/php-b...@lists.php.net/msg02201.html Someone in the php world had

Re: Environment variable not set

2009-02-24 Thread Brandon Taylor
Hi Matt, Yes, I have that env var added to my .bash_profile as well, and it's set to $ORACLE_HOME. If I run Python in a shell, import os and os.environ, I can see the variables and their values appear to be correct...just not running from the built-in Django server. b On Feb 24, 1:55 pm, Matt B

Re: Environment variable not set

2009-02-24 Thread Matt Boersma
On Tue, Feb 24, 2009 at 12:44 PM, Brandon Taylor wrote: > When connecting to Oracle with Django through a shell, everything > works as expected. However, when I use Aptana/PyDev to debug... It sounds likely that debugging environment differs from what "manage.py shell" gets. The other environme

Re: django apache authentication strange behavior with apache indexing.

2009-02-24 Thread Karen Tracey
On Fri, Feb 20, 2009 at 12:59 PM, Jlcarroll wrote: > > I posted this a couple of days ago and didn't get a response. Thought > that I might try again. > > I am creating a private genealogy web page of pictures/obituaries/data > files/census records etc... all just a set of files within a director

Environment variable not set

2009-02-24 Thread Brandon Taylor
Hi everyone, Still battling with Oracle, but found something interesting... When connecting to Oracle with Django through a shell, everything works as expected. However, when I use Aptana/PyDev to debug and I set a breakpoint on my view action, I get an error: InterfaceError: Unable to acquire

Sessions with different expiry dates

2009-02-24 Thread ggates03
Is there any way to have multiple sessions for one browser? Basically I have a need for different cookie values to expire at different times. There are some values I want to expire with the browser session, however there are other values I would like to last longer, for example a last visited da

Re: Unusual Schema question

2009-02-24 Thread Jay Deiman
Alex Gaynor wrote: > > > On Tue, Feb 24, 2009 at 2:10 PM, Jay Deiman > wrote: > > > Jay Deiman wrote: > > The example of the "Comparison" Model in the second link is, at first > > glance, *exactly* what I am looking to do. I think I'm going to >

Re: Unusual Schema question

2009-02-24 Thread Alex Gaynor
On Tue, Feb 24, 2009 at 2:10 PM, Jay Deiman wrote: > > Jay Deiman wrote: > > The example of the "Comparison" Model in the second link is, at first > > glance, *exactly* what I am looking to do. I think I'm going to dig in > > tomorrow and experiment with this configuration, but it looks like thi

Re: Unusual Schema question

2009-02-24 Thread Jay Deiman
Jay Deiman wrote: > The example of the "Comparison" Model in the second link is, at first > glance, *exactly* what I am looking to do. I think I'm going to dig in > tomorrow and experiment with this configuration, but it looks like this > will be perfect for my needs. Indeed, that example is

Re: broken url error in admin

2009-02-24 Thread Jlcarroll
That solves part of the problem: URLField.verify_exists¶ If True (the default), the URL given will be checked for existence (i.e., the URL actually loads and doesn't give a 404 response). But there still appears to be no way to verify the existence of a directory that is protected, which is

Re: Is safe unsafe?

2009-02-24 Thread Michael Repucci
Worked like a charm! Thanks!! On Feb 24, 12:06 pm, Horst Gutmann wrote: > Get the source release > (), > extract it and run `python setup.py install`. At least I assume that > this also works under Windows ;-) > > -- Horst

Re: Is safe unsafe?

2009-02-24 Thread Michael A. Repucci
Worked like a charm! Thanks!! Michael Repucci (M) 718-288-4554 (W) 212-938-5597 mich...@repucci.org http://michael.repucci.org/ On Tue, Feb 24, 2009 at 12:06 PM, Horst Gutmann wrote: > > Get the source release > (< > http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c9.tar.gz#m

Re: django apache authentication strange behavior with apache indexing.

2009-02-24 Thread Jlcarroll
bump? On Feb 20, 10:59 am, Jlcarroll wrote: > I posted this a couple of days ago and didn't get a response. Thought > that I might try again. > > I am creating a private genealogy web page of pictures/obituaries/data > files/census records etc... all just a set of files within a directory > stru

Re: Is safe unsafe?

2009-02-24 Thread Horst Gutmann
Get the source release (), extract it and run `python setup.py install`. At least I assume that this also works under Windows ;-) -- Horst On Tue, Feb 24, 2009 at 6:01 PM, Michael Re

Re: Is safe unsafe?

2009-02-24 Thread Michael Repucci
Hi again. So after much reading and consideration, I decided I'd like to try html5lib. Unfortunately, it seems that the current version html5lib-0.11.1.zip (http://code.google.com/p/html5lib/downloads/list) uses setuptools, whose current version is setuptools-0.6c9.win32- py2.5.exe (http://pypi.py

Re: linking to files from database

2009-02-24 Thread Tonu Mikk
Daniel Roseman wrote: > On Feb 24, 2:36 pm, Tonu Mikk wrote: > >> Then I save it with the above method. The problem I am running into, is >> that when saving the file, it gives is a different name which is the >> original name with an >> "_" at the end. The link in the database also points

Re: linking to files from database

2009-02-24 Thread Alex Gaynor
On Tue, Feb 24, 2009 at 10:41 AM, Daniel Roseman < roseman.dan...@googlemail.com> wrote: > > On Feb 24, 2:36 pm, Tonu Mikk wrote: > > In my case I have the files already on the web server. The only thing > > that I need to do is to link to them from the database. When I try > > using the method

Re: select_related() and reverse foreign keys -OR- how to I get a blog post and its comments?

2009-02-24 Thread Sean Patrick Hogan
Thanks for the input! So, I'm assuming by "easiest case" you mean just calling LEFT OUTER JOINs. That's Rails behavior and then it deals with it in Ruby. I'm not too familiar with SQLAlchemy, but it looks like that's what they're doing in their EagerLoader as well. The only way I can think of o

Support for HTML arrays in Django forms

2009-02-24 Thread A B
Is there any way to create a form that expects an array using the name="field[]" HTML construct. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djan

March 2, 2009 Pyowa Meeting

2009-02-24 Thread Mike Driscoll
Hi, Just a quick note to say that our next Pyowa (Python Users Group of Iowa) meeting will be next Monday, March 2nd from 7-9 p.m. We will be in our original location at the Marshall County Sheriff's Office, 2369 Jessup Ave, Marshalltown, IA. Remember, it's technically NOT in Marshalltown at all.

Custom Admin Save redirect?

2009-02-24 Thread Alfonso
Is it possible to define a url for the admin form submit? I'd like to redirect a user to a custom list view I've created (outside admin) following the save of a record update or record addition. Is that possible through the 'admin/submit_line.html' template? For example I'd like a user to end u

Re: Custom Admin Save redirect?

2009-02-24 Thread peschler
You can write you own admin class and implement the following methods. Below is an example of an admin class which changes the redirect for the add, change and delete stage. I am not sure if this is the best way to do it, but it works: --- class YourClassAdmin(admin.ModelAdmin): def response

Re: linking to files from database

2009-02-24 Thread Daniel Roseman
On Feb 24, 2:36 pm, Tonu Mikk wrote: > In my case I have the files already on the web server.  The only thing > that I need to do is to link to them from the database.  When I try > using the method above, I first read the file into memory like so > (http://docs.djangoproject.com/en/dev/topics/fi

Re: Django App build - the right process?

2009-02-24 Thread Allfonso
Thanks guys, Signals I think is beyond me for the time being but Mark I think I see what you're saying... you mean define an 'adjust_price' method outside of save and call that when necessary? Cleaning up the code would help me get through the rest of it! The last save method is indeed a compli

Dealing with multiple M2Ms

2009-02-24 Thread jgentry
Hi there ... Suppose I have three Models: Model A Model B, has a M2M with Model A Model C, has M2Ms with both Model A and Model B What I'm trying to do is to construct a query which will answer the following question: "For a given A, what Cs does it have a relationship with, either through i

Re: How can one template extend multiple templates?

2009-02-24 Thread Mark Jones
It seems like maybe I don't understand the question but it will extend an infinite number of templates Just add {% extends "base.html" %} into every template you want to extend. You can even do {% extends "derived.html" %} which extends base.html On Feb 24, 8:41 am, lzhshen wrote: > Suppose I

Re: Is safe unsafe?

2009-02-24 Thread Michael Repucci
Hi Everybody, I just wanted to give a HUGE THANKS to everyone participating in this discussion. It's exactly the kind of information I was hoping I could get from all of you; more than enough to keep a newbie like me occupied on the topic for quite some time. So thanks again for sharing your knowl

Re: Securely storing passwords

2009-02-24 Thread Mark Jones
How about integrating with something like OpenID? Not sure if it would do the trick, but it might be a step in the right direction, assuming the sites you are interoperating with are 'friendly' On Feb 24, 5:49 am, LaundroMat wrote: > Hi - > > I'm working on a small django app that allows users

Re: Django App build - the right process?

2009-02-24 Thread Mark Jones
The first 2 saves are overly complex: def save(self): if self.unit_price and not self.price_discount == '0': adjust = float(self.price_discount / 100.0) val_result = str(adjust) discount = Decimal(self.unit_price - (Decimal(val_result) * self.unit_price)) self.product_

Re: how to show currently selected choices in ManyToMany fo

2009-02-24 Thread Margie
I think I'm going to try to come up with a more exact example of what I'm doing. I spent all last evening on this - could just not get the initial values set on my ModelMultipleChoiceForm. I guess I'll have to back up and start using a manage.py shell and pdb and step thrrough the django code t

How can one template extend multiple templates?

2009-02-24 Thread lzhshen
Suppose I have base template called "base.html", can it extend more then two other template, such as "a01.html" and "a02.html"? Thanks in advance! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group

Django App build - the right process?

2009-02-24 Thread Alfonso
I've been putting together a Product Database and Customer Order application that requires a lot of interim calculations, things like tax, customer discounts etc. Due to my limited knowledge of django/ python I have been basically performing these calculations in a custom save function of the app

Re: linking to files from database

2009-02-24 Thread Tonu Mikk
Tonu Mikk wrote: > Jacob Kaplan-Moss wrote: > >> On Tue, Feb 17, 2009 at 1:15 PM, Tonu Mikk wrote: >> >> >>> Looking at the database, I see a photo and thumbnail columns, but there >>> is no data. Do I need to write code to store a link to images in the >>> photo and thumbnail columns

Re: Django App build - the right process?

2009-02-24 Thread LaundroMat
On Feb 24, 3:25 pm, Alfonso wrote: > I've been putting together a Product Database and Customer Order > application that requires a lot of interim calculations, things like > tax, customer discounts etc.  Due to my limited knowledge of django/ > python I have been basically performing these calcu

Re: Not understand help_text

2009-02-24 Thread Mark Jones
I occurred to me last night right before sleep that I can patch this in my code by deriving all my forms from my MyForm, fixing it in one place and remaining DRY. Nice to see I'm not the only one that found this to be a bit strange. --~--~-~--~~~---~--~~ You rece

Re: Securely storing passwords

2009-02-24 Thread Matthias Kestenholz
Hi, On Tue, Feb 24, 2009 at 12:49 PM, LaundroMat wrote: > > Hi - > > I'm working on a small django app that allows users to interact with > other websites where they have an account. Ofcourse, using this app > means providing your username and password for the other website. > > What are the mos

Re: Is safe unsafe?

2009-02-24 Thread Brian Neal
On Feb 23, 10:51 pm, Jacob Kaplan-Moss wrote: > On Mon, Feb 23, 2009 at 7:49 PM, Brian Neal wrote: > > Interesting, I've also come across this: > > >http://codespeak.net/lxml/lxmlhtml.html#cleaning-up-html > > > I've heard it is very fast as it is just a python binding to a C- > > library...? >

Internationalization

2009-02-24 Thread samira
Hello all I am looking good document about localization, As I read Djangoproject document and I cannot learn. could anybody good refrence about it? Thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dj

Re: get_absolute_url() and related models

2009-02-24 Thread Ben Davis
Thank you so much! It's funny because I had originally tried category__slug, not sure why it didn't occur to me to use self.category.slug ! Also, I'm glad to have learned about select_related() -- that's exactly what I was looking for! On Mon, Feb 23, 2009 at 6:36 PM, Malcolm Tredinnick < m

Re: Table or view does not exist - Oracle

2009-02-24 Thread Brandon Taylor
Hi Karen, Yes, that is exactly what I'm seeing. On Feb 23, 6:02 pm, Karen Tracey wrote: > On Mon, Feb 23, 2009 at 10:15 AM, Brandon Taylor > wrote: > > > > > > > Hi everyone, > > > Still fighting with Oracle :( > > > Quick recap...my setup is: > > > OS X 10.5.6 (Intel), cx_Oracle-5.0.1 (Intel)

Re: Django Template - i18n & filters and inner variables ?

2009-02-24 Thread MartinBorthiry
> > 1/ Using the i18n internationalization module, I would like to combine > > the translation with pluralize and capfirst filters. I know I’m a > > crazy dog. > > > {% trans 'tag' %}{{ tag_list|pluralize }} > > => All right, everything is ok. > > > But now, how can I specify the capfirst facili

Re: Django Template - i18n & filters and inner variables ?

2009-02-24 Thread Daniel Roseman
On Feb 24, 1:19 pm, Brogno wrote: > Dear djangonauts, > > I’m a newbie, a djangonoob ;) So, I have few little questions about > Django’s template system. Just for you information, I get Django 1.0.2 > > 1/ Using the i18n internationalization module, I would like to combine > the translation with

Django Template - i18n & filters and inner variables ?

2009-02-24 Thread Brogno
Dear djangonauts, I’m a newbie, a djangonoob ;) So, I have few little questions about Django’s template system. Just for you information, I get Django 1.0.2 1/ Using the i18n internationalization module, I would like to combine the translation with pluralize and capfirst filters. I know I’m a cr

Re: Not understand help_text

2009-02-24 Thread Alex Gaynor
On Tue, Feb 24, 2009 at 8:08 AM, bruno desthuilliers < bruno.desthuilli...@gmail.com> wrote: > > > > On 24 fév, 05:46, Mark Jones wrote: > > That is exactly the kind of WET I was talking about. as_p() with > > appropriate CSS styling will render really nice forms as is, with the > > exception of

Re: Not understand help_text

2009-02-24 Thread bruno desthuilliers
On 24 fév, 05:46, Mark Jones wrote: > That is exactly the kind of WET I was talking about.  as_p() with > appropriate CSS styling will render really nice forms as is, with the > exception of the help_text.  I even think that could be fixed without > any major rework, just a change in the as_p()

Re: Securely storing passwords

2009-02-24 Thread Alex Gaynor
On Tue, Feb 24, 2009 at 6:49 AM, LaundroMat wrote: > > Hi - > > I'm working on a small django app that allows users to interact with > other websites where they have an account. Ofcourse, using this app > means providing your username and password for the other website. > > What are the most secu

Re: A question about templates and search.

2009-02-24 Thread djandrow
Oh yea, thanks, i was a bit confused. I see what I can do now. Andrew On 24 Feb, 09:02, Daniel Roseman wrote: > On Feb 23, 10:51 pm, djandrow wrote: > > > Yea, the code that processes the search and returns the results. > > Does it not need to go in views.py? Could i just import it? > > Import

Securely storing passwords

2009-02-24 Thread LaundroMat
Hi - I'm working on a small django app that allows users to interact with other websites where they have an account. Ofcourse, using this app means providing your username and password for the other website. What are the most secure ways of handling this information? I suppose encrypting the pas

Re: Send_mail usage on development server.

2009-02-24 Thread NoviceSortOf
Thanks for these solutions, I didn't realize Email-host could be used for any external email server, although unwittingly I may of tried it earlier and had authentication problems. The python dummy email server solution you point to... "python -m smtpd -n -c DebuggingServer localhost:1025" also

Re: model inheritance without a new database table

2009-02-24 Thread Ryan Kelly
> > is there a way to have a model subclass avoid the creation of a > > new database table,and just take its data straight out of the table for > > its superclass? > > Right now, I suspect you would also have to manually set Meta.db_table > and some things like that. However, I strongly suspect

Re: how to show currently selected choices in ManyToMany fo

2009-02-24 Thread Daniel Roseman
On Feb 24, 5:09 am, Margie wrote: > Ok - I think I should actually be using initial - but still haven't > gotten that to actually work.  I'm trying something like this: > > In models.py > class Book(models.Model): >      title = models.CharField(max_length=100) >      authors = models.ManyToManyF

Re: A question about templates and search.

2009-02-24 Thread Daniel Roseman
On Feb 23, 10:51 pm, djandrow wrote: > Yea, the code that processes the search and returns the results. > Does it not need to go in views.py? Could i just import it? > Import it where? Presumably, even though you have a search box on every page, when you submit a search (no matter where from) yo