Model update one more time

2005-08-24 Thread Krzysztof Drozd
Maniac17 Sie. 23:57: Subject Model updates I wonder how Django's object-relational mapping handles update to models? Let's say I want to replace one old field with two new fields. Can this be handled more or less automatically? Will I lose values from this one field, or whole table, or whole

Re: EmailFields and Spam

2005-08-24 Thread Krzysztof Drozd
update :) dot = [" dot "," [dot] ", " -dot- "," [kropka] "," _ "] and kropka = . malpka/malpka = @ in pl_PL kd.

Re: EmailFields and Spam

2005-08-24 Thread Krzysztof Drozd
your idea was QL :) but this is may way: django/utils/text.py: def spamprotect(value): '''Make Spam protected email address''' at = [" at "," [at] ", " -at- "," [malpka] "," # ",] dot = [" dot "," [dot] ", " -do-] "," [kropka] "," _ "] import random random_spam_protector = r

Re: EmailFields and Spam

2005-08-24 Thread Milton Waddams
here's a quick filter I knocked up which will randomise the protection (add some more into the lists for better randomisation). There's probably a more correct place to put it, though I put it in django/core/defaultfilters.py def spamprotect(value, _): "Make Spam protected email address"

Re: EmailFields and Spam

2005-08-24 Thread Adrian Holovaty
On 8/24/05, Krzysztof Drozd <[EMAIL PROTECTED]> wrote: > howto make django's emailFields spam safe? > in admin Interface i put [EMAIL PROTECTED] byt in my view i get my]#[my.net or > my[ape]_my_net You can write a custom method on your model to return the "spam-safe" version of the e-mail address

EmailFields and Spam

2005-08-24 Thread Krzysztof Drozd
hi all howto make django's emailFields spam safe? in admin Interface i put [EMAIL PROTECTED] byt in my view i get my]#[my.net or my[ape]_my_net thanks kd.

Re: importing modules

2005-08-24 Thread [EMAIL PROTECTED]
Another possibility would be to simply encourage the placing of the 'project.apps' directory in the PYTHONPATH as well as the parent directory of 'project'. If this was the convention, then people could simply simply use the form: myproject.models.modulename myproject.utils.anothermodule etc. T

Re: importing modules

2005-08-24 Thread [EMAIL PROTECTED]
In briefly playing around, I couldn't figure out a way to use the INSTALLED_APPS tuple to extend the module path. I just don't have that sort of kung-fu with python and manipulating modules. The one thing I came up with instead is creating a new SETTING called "EXTENSION_APPS_DIR". This would be

Re: importing modules

2005-08-24 Thread [EMAIL PROTECTED]
So, to add an app to a new project, you just need to include it in the INSTALLED_APPS tuple as "ellington.apps.your_app_name"? This works for me, but I am concerned about easily sharing applications with other people and being able to do imports within my application. My one suggestion is to use

Re: importing modules

2005-08-24 Thread Adrian Holovaty
On 8/24/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Because of this, "project.apps.application.module" should work and it > does for me. But, this isn't ideal since I do want there to be a > dependency on the project name in my apps that I want to be able to > share and drag-and-drop into m

Re: importing modules

2005-08-24 Thread [EMAIL PROTECTED]
Is this by default? I don't have the 'apps' module from my project available to me in my View. According to the instructions on the django website, it is the "parent" directory of your project that you should include in the path, not the project directory itself. Because of this, "project.apps.ap