Re: get_absolute_url() using related models slugs

2008-04-24 Thread Merrick
Thank you Malcolm and Karen, I had to step for the day but when I got home I read your comments and fixed the issue which was exactly as you both pointed out. this helped make my photo model much more search friendly. @permalink def get_absolute_url(self): return ('photo_detail',

Re: GenericRelation error

2008-04-24 Thread Malcolm Tredinnick
On Thu, 2008-04-24 at 22:59 -0700, Eric Abrahamsen wrote: > I'm trying to implement a very basic tagging function using generic > relations, and running into errors I don't understand. The basic setup > is, I've got a model called Series, and series should be linkable to > many models via a

GenericRelation error

2008-04-24 Thread Eric Abrahamsen
I'm trying to implement a very basic tagging function using generic relations, and running into errors I don't understand. The basic setup is, I've got a model called Series, and series should be linkable to many models via a SeriesItem model. Following the instructions here: http://www.djan

Re: Django Registration Error (Does not return from SMTP call)

2008-04-24 Thread stranger
Hey, I think you should take a look at this. I used this and its working fine. http://www.djangosnippets.org/snippets/141/ Do remember to install 'libgmail' module inorder to get this working. On Apr 24, 10:55 am, Szaijan <[EMAIL PROTECTED]> wrote: > I am building my first Django app and tr

Re: sys.path on freebsd 6.2 HALP!

2008-04-24 Thread Malcolm Tredinnick
On Thu, 2008-04-24 at 19:44 -0700, zoggernaut wrote: [...] > > SetHandler python-program > PythonHandler django.core.handlers.modpython > SetEnv DJANGO_SETTINGS_MODULE frobnitz.settings > #SetEnv DJANGO_SETTINGS_MODULE settings.py > PythonDebug On > PythonPath "['/usr/hom

Re: AttributeError with Markdown

2008-04-24 Thread Malcolm Tredinnick
On Thu, 2008-04-24 at 17:27 -0700, Scott McCracken wrote: > Please excuse my apparent inability to figure out local server issues. > I would simply like to use Markdown to format text in my Django app: > * I have Django setup locally (OS X), with 'django.contrib.markup' > added to my INSTALLED_AP

Re: Adding an extra INNER JOIN

2008-04-24 Thread Malcolm Tredinnick
On Thu, 2008-04-24 at 15:29 -0700, jonknee wrote: > > Look at the 'tables' and 'where' parameters to the extra() method on > > querysets. > > > > I got very close with the tables parameter, but it always adds in a > comma between the existing INNER JOIN statements and the one I'm > trying to add

Re: Django and CSS

2008-04-24 Thread Darryl Ross
Rodney Topor wrote: OK, sorry for the unclear message. I've now discovered that if I use an embedded CSS file in a template - h1 { color: red} - then it works correctly. But if I use an external CSS file in a template - - then, even if the style sheet only changes font colors, the effect is tha

Re: Rendering HTML stored in database

2008-04-24 Thread [EMAIL PROTECTED]
There is a safe filter, so {{ myvar|safe }}. You can also look into using the autoescape tag, too. Check out the documentation listed here: http://www.djangoproject.com/documentation/templates/#automatic-html-escaping Hope that helps! -Eric Florenzano On Apr 24, 11:57 pm, Brandon Taylor <[EMA

Rendering HTML stored in database

2008-04-24 Thread Brandon Taylor
Hi everyone, I've got TinyMCE integrated into my admin, and is working great, but when I output the HTML for the record into my template, the HTML tags are being rendered as plain text, as in, all of the tags are visible. What can I do to allow HTML stored in my database to render properly in th

@@@hai my friend dont see this mail@@@

2008-04-24 Thread nmk
very beauty ful game www.mobilegalaxy.net.tc --~--~-~--~~~---~--~~ 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 unsubscribe from this group, sen

Re: Django and CSS

2008-04-24 Thread Rodney Topor
On Apr 25, 1:01 pm, gmacgregor <[EMAIL PROTECTED]> wrote: > > http://groups.google.com/group/django-users/browse_thread/thread/906a... Thank you. Now I understand this issue. > It's best to create a "templates" directory and then within that > directory create directories that correspond to e

Re: Flatpages for static HTML pages?

2008-04-24 Thread Jay Parlar
On 4/24/08, Rodney Topor <[EMAIL PROTECTED]> wrote: > > Is Flatpages required to display every static HTML page? It seems to > require a fair bit of work by the programmer, and requires additional > tables and rows in the database. I guess it's simpler for the > programmer than writing a ne

Re: sys.path on freebsd 6.2 HALP!

2008-04-24 Thread Rishabh Manocha
I'm having similar issues gettind mod_python to work with Apache on a windows box. I don't have my httpd.conf in front of me atm, but i'm basically seeing what zoggernaut is seeing :( Best, R On 25-Apr-08, at 8:14 AM, zoggernaut wrote: > > FYI, I followed the instructions on the tutorial po

Re: Django and CSS

2008-04-24 Thread Erik Vorhes
Put your CSS files in your media directory. If your media url is "http://yoursite/media/";, then you could do something like and you should see your intended style. On Thu, Apr 24, 2008 at 10:01 PM, gmacgregor <[EMAIL PROTECTED]> wrote: > > > On Apr 24, 10:49 pm, Rodney Topor <[EMAIL PROTECTE

Flatpages for static HTML pages?

2008-04-24 Thread Rodney Topor
Is Flatpages required to display every static HTML page? It seems to require a fair bit of work by the programmer, and requires additional tables and rows in the database. I guess it's simpler for the programmer than writing a new view for every static HTML page, though this would not require d

Re: Django and CSS

2008-04-24 Thread gmacgregor
On Apr 24, 10:49 pm, Rodney Topor <[EMAIL PROTECTED]> wrote: > So, if my project has a directory structure "mysite/templates/app/ > template.html", then in which directory should I place the CSS file? You'll find this thread helpful: http://groups.google.com/group/django-users/browse_thread/thr

Re: EmailMessage improperly Configured

2008-04-24 Thread NoobStick
I forgot to add I am using the most recent release of SVN. --~--~-~--~~~---~--~~ 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 unsubscribe from

EmailMessage improperly Configured

2008-04-24 Thread NoobStick
Well I have been attempting to make this work for me http://code.google.com/p/django-registration/ in conjunction with the gmail piece, but I think I am missing something. I changed my settings file accordingly and the other file as directed. I have libgmail installed, from django.core.mail impo

Re: Django and CSS

2008-04-24 Thread Rodney Topor
OK, sorry for the unclear message. I've now discovered that if I use an embedded CSS file in a template - h1 { color: red} - then it works correctly. But if I use an external CSS file in a template - - then, even if the style sheet only changes font colors, the effect is that the font style is c

Re: sys.path on freebsd 6.2 HALP!

2008-04-24 Thread zoggernaut
FYI, I followed the instructions on the tutorial posted here: http://www.djangoproject.com/documentation/tutorial01 Below is my settings.py Mod_python runs fine. settings.py - DEBUG = True TEMPLATE_DEBUG = DE

Re: Weblog archive links are bad

2008-04-24 Thread Chatchai Neanudorn
Hi, You can pass "allow_empty=True" to generic views in case of you don't like 404. Cheer Chatchai 2008/4/24 David Reynolds <[EMAIL PROTECTED]>: > > > On 21 Apr 2008, at 10:14 pm, Jon Lesser wrote: > > > It seems that if there are no entries for a particular month, the > > archive link to that

Re: Are any of you successfully running Django on IIS?

2008-04-24 Thread 头太晕
http://code.google.com/p/pyisapi-scgi/ On Fri, Apr 25, 2008 at 1:35 AM, jmDesktop <[EMAIL PROTECTED]> wrote: > > I have a requiremnet to use Django on IIS. I know there is a wiki > page on Django about it, but what I'm after is if anyone is actually > using it daily in production. Just hoping t

AttributeError with Markdown

2008-04-24 Thread Scott McCracken
Please excuse my apparent inability to figure out local server issues. I would simply like to use Markdown to format text in my Django app: * I have Django setup locally (OS X), with 'django.contrib.markup' added to my INSTALLED_APPS. * I installed python-markdown by following the official instruc

Re: Having a instance of a model object instantiate another

2008-04-24 Thread jrmorrisnc
So, after re-reading the related_name / related_objects documentation I've dealt with my lack of understand on properly getting __str__ method to return what I want, I thnk. And the other part, creating an instance of CheckList whenever an Event is created should be easy, too. Just wasn't lookin

Re: mod_python or fcgi

2008-04-24 Thread Don Spaulding
On Apr 24, 6:34 am, Rufman <[EMAIL PROTECTED]> wrote: > Hey Graham > > thanks for the insight > > Stephane I won't debate any of what Graham has said, as it's a pretty standard answer from what I've seen, and he's a lot smarter than me. I just want to note that fastcgi makes a nice separation

Re: Calling self.related_object.save() from self.save() ???

2008-04-24 Thread Don Spaulding
On Apr 23, 7:23 pm, "Jorge Vargas" <[EMAIL PROTECTED]> wrote: > On Wed, Apr 23, 2008 at 11:09 AM, Don Spaulding > > <[EMAIL PROTECTED]> wrote: > > > On Apr 22, 11:24 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> > > wrote: > > > > On Tue, 2008-04-22 at 13:47 -0700, Don Spaulding wrote: > > > > [

Re: Adding an extra INNER JOIN

2008-04-24 Thread jonknee
> Look at the 'tables' and 'where' parameters to the extra() method on > querysets. > I got very close with the tables parameter, but it always adds in a comma between the existing INNER JOIN statements and the one I'm trying to add (which leads to a MySQL error). That makes sense because its mea

Re: Adding new language for i18n

2008-04-24 Thread Ramiro Morales
On Thu, Apr 24, 2008 at 4:07 PM, Mihai Damian <[EMAIL PROTECTED]> wrote: > > So new lines on blocktrans tags get a \r\n on Windows as opposed to > just \n on Linux. That's what's causing the whole problem. Maybe the > make-messages.py could be modified to check if os.name is nt or os2 > and if

Re: GeoDjango: distance between PointFields problem

2008-04-24 Thread Nathaniel Whiteinge
On Apr 23, 9:23 am, Justin Bronn <[EMAIL PROTECTED]> wrote: > > A PointField from that same model containing lat/long pairs obtained > > from the Google geocoder. Quick follow-up in case anyone else has a similar problem. The Google geocoder annoyingly returns latitude and longitude as y/x instea

Having a instance of a model object instantiate another

2008-04-24 Thread John Morris
Hi, I have the following: class Event(models.Model): date = models.DateTimeField() description = models.TextField() def __str__(self): return self.date class Admin:pass class CheckList(models.Model): name = models.CharField(max_length=32)

Re: sys.path on freebsd 6.2 HALP!

2008-04-24 Thread Rajesh Dhawan
> ImportError: Could not import settings 'frobnitz.settings' (Is it on > sys.path? Does it have syntax errors?): No module named > frobnitz.settings So as the error clearly asks you: 1. Does your frobnitz/settings.py have syntax errors? 2. Is it in your PYTHONPATH? Your Apache conf for the appli

Re: Are signals wrapped in the same transaction as model saves?

2008-04-24 Thread Rajesh Dhawan
Hi, On Apr 24, 11:33 am, meppum <[EMAIL PROTECTED]> wrote: > If you create a listener for a certain models post_save signal and the > corresponding function is supposed to create or update another object, > will all this be saved in the same transaction? It should be, yes. Signal handlers are la

Re: refence a variable in a template in side another variable

2008-04-24 Thread Raisins
Awesome, this worked perfectly. I completely forgot about custom template tags. I can now build the form dynamically and display any info from the object. On Apr 24, 1:51 pm, "Phil Davis" <[EMAIL PROTECTED]> wrote: > 2008/4/24Raisins<[EMAIL PROTECTED]>: > > > > If you really want to do it you can

Re: Adding new language for i18n

2008-04-24 Thread Mihai Damian
So new lines on blocktrans tags get a \r\n on Windows as opposed to just \n on Linux. That's what's causing the whole problem. Maybe the make-messages.py could be modified to check if os.name is nt or os2 and if so read the target file, replace \r with '', write the new content to a temporary file

sys.path on freebsd 6.2 HALP!

2008-04-24 Thread zoggernaut
sys.path ServerName: 'spork.piggify.org' DocumentRoot: '/usr/local/www/apache22/data' URI:'/frobnitz/' Location: '/frobnitz/' Directory: None Filename: '/usr/local/www/apache22/data/frobnitz/' PathInfo: '' Phase: 'PythonHandler' Handler:

Re: get_absolute_url() using related models slugs

2008-04-24 Thread Karen Tracey
On Thu, Apr 24, 2008 at 12:21 PM, Merrick <[EMAIL PROTECTED]> wrote: > > Thank you, I updated get_absolute_url to take into consideration the > fact that I was erroneously using state_slug instead of state.slug and > the same with photo.slug and place.slug > >def get_absolute_url(self): >

Django Registration Error (Does not return from SMTP call)

2008-04-24 Thread Szaijan
I am building my first Django app and trying to incorporate django- registration. Whenever a link gets clicked that calls for sending mail to a user, the page loads continually with no timeout. No errors are generated and no URL info appears in STDOUT or STDERR when running on the dev server. T

Re: refence a variable in a template in side another variable

2008-04-24 Thread Phil Davis
2008/4/24 Phil Davis <[EMAIL PROTECTED]>: > 2008/4/24 Raisins <[EMAIL PROTECTED]>: > [...] > {% for x in form %} > {{x.item.some_x_attr}} > {{x}} > {% endfor %} > I forgot that within the template there is a BoundField wrapper around each real form field so the above example should be: {%

Re: Are any of you successfully running Django on IIS?

2008-04-24 Thread Justin Lilly
I finally got it working. You can check out the results at http://niethestate.com/trafficstops/ It was painful, though. Use apache if you can. I've talked my corp. into buying some linux servers at server beach so hopefully it will be much easier. -justin On Thu, Apr 24, 2008 at 1:35 PM, jmDeskto

Django Registration Error (Does not return from SMTP call)

2008-04-24 Thread Szaijan
I am building my first Django app and trying to incorporate django- registration. Whenever a link gets clicked that calls for sending mail to a user, the page loads continually with no timeout. No errors are generated and no URL info appears in STDOUT or STDERR when running on the dev server. T

Re: refence a variable in a template in side another variable

2008-04-24 Thread Phil Davis
2008/4/24 Raisins <[EMAIL PROTECTED]>: > > I have moved along some more. Now Using this snippet ( > http://www.djangosnippets.org/snippets/148/ ) > > z = FOO.objects.get(id=pram_id) > y = z.BAR.filter(off = False) > #. > form_dict = {} > for x in y: > form_dict[x.id] = forms.Boo

Re: two column unique index?

2008-04-24 Thread Tim Saylor
Thanks Malcom, I don't know why I thought it didn't work last night. I guess I shouldn't try to figure out new stuff in the 13th working hour of the day. On Apr 24, 12:49 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Wed, 2008-04-23 at 22:19 -0700, Tim Saylor wrote: > > I have two column

Are any of you successfully running Django on IIS?

2008-04-24 Thread jmDesktop
I have a requiremnet to use Django on IIS. I know there is a wiki page on Django about it, but what I'm after is if anyone is actually using it daily in production. Just hoping to see how it's going. If not I have to persuade to use Apache on the Windows box. Thanks. --~--~-~--~~--

Re: order_by for related tables

2008-04-24 Thread Kevin Monceaux
Matias, On Thu, 24 Apr 2008, Matias Surdi wrote: > I can't get to work the order_by('related_table.field') as described in > http://www.djangoproject.com/documentation/db-api/#order-by-fields > > Is this documentation correct? I think it's close. To get the above to work in cases were I've use

Re: At what point does a model get its own app? Wigging as I try to adjust to the Django way.

2008-04-24 Thread joasch
Being new in the Python/Django camp (2 weeks) but doing php for several years, I find this a very interesting topic and I would like to extend the question a bit, like "when is an app becoming too big?" The use case here is when you develop a rather complicated "app" which need to have quite some

order_by for related tables

2008-04-24 Thread Matias Surdi
Hi again, I can't get to work the order_by('related_table.field') as described in http://www.djangoproject.com/documentation/db-api/#order-by-fields Is this documentation correct? I'm using django from SVN trunk. Thanks. --~--~-~--~~~---~--~~ You received th

Re: Getting the user object into a newform

2008-04-24 Thread Nathaniel Whiteinge
On Apr 24, 4:44 am, nickloman <[EMAIL PROTECTED]> wrote: > class MyForm(forms.Form): > def __init__(self, user, data=None): > forms.Form.__init__(self, data) > > self.fields['my_options'] = > ModelChoiceField(queryset=SomeModel.objects.get_users_objects(user)) You're on the ri

Re: get_absolute_url() using related models slugs

2008-04-24 Thread Merrick
Thank you, I updated get_absolute_url to take into consideration the fact that I was erroneously using state_slug instead of state.slug and the same with photo.slug and place.slug def get_absolute_url(self): return ('photo-detail', None, { 'state' : self.photo.place.city.state.slug ,

Re: get_absolute_url() using related models slugs

2008-04-24 Thread Malcolm Tredinnick
On Thu, 2008-04-24 at 09:08 -0700, Merrick wrote: > Sorry to confuse things, I actually thought putting the shell output > would give a bigger picture. > > The problem I am trying to solve is getting related to > get_absolute_url() > > >>> photo.get_absolute_url() > Traceback (most recent call

Re: get_absolute_url() using related models slugs

2008-04-24 Thread Merrick
Sorry to confuse things, I actually thought putting the shell output would give a bigger picture. The problem I am trying to solve is getting related to get_absolute_url() >>> photo.get_absolute_url() Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.4/site-pack

Re: get_absolute_url() using related models slugs

2008-04-24 Thread Malcolm Tredinnick
On Thu, 2008-04-24 at 08:55 -0700, Merrick wrote: [...] > ***Shell output > > >>> from photologue.models import * > >>> photo = Photo.objects.get(slug='golf-course-3') > >>> photo.place.city.state_slug > Traceback (most recent call last): > File "", line 1, in ? > AttributeError: 'City' object

get_absolute_url() using related models slugs

2008-04-24 Thread Merrick
I am still learning Django, and appreciate all of the help I have received. I spent a few hours on this and just cannot figure out how to pull off the get_absolute_url() function the way I describe it below for the Photo class. I want to use the slugs for related models and step through multiple r

Re: At what point does a model get its own app? Wigging as I try to adjust to the Django way.

2008-04-24 Thread Norman Harman
Erik Vorhes wrote: > There's nothing wrong with parceling out models across different apps. > And unless you're planning on distributing each app separately, don't > worry about cross-app dependencies. > > In this case, I'd encourage you to--since you'll probably want to do > more than just book-

Re: Adding new language for i18n

2008-04-24 Thread Chatchai Neanudorn
Yes, it seem to be problem only on Window environment. I asked my friend to run command under Linux. It works fine. Cheers. Chatchai 2008/4/24 Mihai Damian <[EMAIL PROTECTED]>: > > Not shure yet but this could be a Windows only issue. I'll get back > later with some tests. > > > --~--~---

Re: Search with Stemming, Accents and Entities

2008-04-24 Thread Jarek Zgoda
Rodrigo Culagovski napisał(a): > it looks like Solr has its own database. The application is in Django, > so it wouldn't make any sense to replicate the database in the search > engine. Solr has an index, not a database. This is complete search and indexing machinery. Think "mini-google". -- J

Re: Confusion over new users and admin pages

2008-04-24 Thread Malcolm Tredinnick
On Thu, 2008-04-24 at 05:15 -0700, LaundroMat wrote: > Hi, > > When creating a new user, is_active is automatically set to True. The > django docs say this means "Designates whether this account can be > used to log in. Set this flag to False instead of deleting accounts." > > On the admin page

Re: Search with Stemming, Accents and Entities

2008-04-24 Thread Rodrigo Culagovski
Jarek, it looks like Solr has its own database. The application is in Django, so it wouldn't make any sense to replicate the database in the search engine. Thanks, Rodrigo On Apr 24, 5:37 am, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Rodrigo Culagovski napisał(a): > > > I am implementing an aca

Re: Confusion over new users and admin pages

2008-04-24 Thread Valts Mazurs
Hi, AFAIK both flags have to be set to true to allow user to log into admin interface. Regards, Valts On Thu, Apr 24, 2008 at 3:15 PM, LaundroMat <[EMAIL PROTECTED]> wrote: > > Hi, > > When creating a new user, is_active is automatically set to True. The > django docs say this means "Designates

Re: Adding new language for i18n

2008-04-24 Thread Mihai Damian
Not shure yet but this could be a Windows only issue. I'll get back later with some tests. --~--~-~--~~~---~--~~ 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@google

Re: Adding new language for i18n

2008-04-24 Thread Mihai Damian
Hi, I'm also trying to update the .po for Romanian. I was runing make- messages.py -l ro to update the .po and got the same error as chatchai. I presume this is a bug in bookmarklets.html, right? Thanks Mihai --~--~-~--~~~---~--~~ You received this message becau

Re: Announcing the Django Dash!

2008-04-24 Thread [EMAIL PROTECTED]
Sorry for the delay on clarification. The design can be done (on paper, no code) ahead of time. Designers are considered a member of the team so they're part of the 2 person limit. And the 2 person limit is there to even the playing field. If more people think that limit is too small, I'd conside

Re: Weblog archive links are bad

2008-04-24 Thread David Reynolds
On 21 Apr 2008, at 10:14 pm, Jon Lesser wrote: > It seems that if there are no entries for a particular month, the > archive link to that month results in a 404. > http://www.djangoproject.com/weblog/2008/apr/ <--Works > http://www.djangoproject.com/weblog/2008/mar/ <--404 > > I tried to open a

refence a variable in a template in side another variable

2008-04-24 Thread Raisins
I have moved along some more. Now Using this snippet ( http://www.djangosnippets.org/snippets/148/ ) z = FOO.objects.get(id=pram_id) y = z.BAR.filter(off = False) #. form_dict = {} for x in y: form_dict[x.id] = forms.BooleanField(required= False) # form = DynForm() form.setFields

ModelForm + FormPreview + form.save() call in done() never update objects if PK is AutoField

2008-04-24 Thread sector119
Hi ALL! If I use ModelForm + FormPreview + form.save() call in done() it never update objects if PK is AutoField, but always create them, why it can be so? FormPreview doesn't store PK value enywhere (ex.: to use in form.instance.pk to determine that it is an update not create) ? I redefine some

Re: trying to edit the geodjango wiki page

2008-04-24 Thread Tyler Erickson
That worked. Thanks! Darryl Ross wrote: > I believe you need to go to the 'settings' page and enter a name and > email address first. > > Cheers > -D > > Tyler Erickson wrote: > > What do I need to do to edit the following page? > > http://code.djangoproject.com/wiki/GeoDjango > > > > It lets me

Confusion over new users and admin pages

2008-04-24 Thread LaundroMat
Hi, When creating a new user, is_active is automatically set to True. The django docs say this means "Designates whether this account can be used to log in. Set this flag to False instead of deleting accounts." On the admin pages of a django website however, next to the "Active" flag, the descri

Re: form.save() allways save data, never update

2008-04-24 Thread sector119
strange, when I use preview and change any field it create new object, not update him. I just call form.save() in done() method, and I change post_post() a bit to pass form instance, not just cleaned_data to the done method :/ Is there something wrong with form instance that it is not passed to do

Re: mod_python or fcgi

2008-04-24 Thread Rufman
Hey Graham thanks for the insight Stephane On Apr 24, 2:22 am, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On Apr 24, 12:57 am, Rufman <[EMAIL PROTECTED]> wrote: > > > Hey > > > I was wondering: Is Django faster and stabler using mod_python or > > fcgi? > > > I read that mod_python can be a m

Re: form.save() allways save data, never update

2008-04-24 Thread sector119
Thanks a lot, Malcolm! On Apr 24, 2:25 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2008-04-24 at 04:21 -0700, sector119 wrote: > > ok I've added instance=object! > > > is it ok, that when I change PK value and call form.save() it create > > new item, and not just update PK value o

Re: form.save() allways save data, never update

2008-04-24 Thread Malcolm Tredinnick
On Thu, 2008-04-24 at 04:21 -0700, sector119 wrote: > ok I've added instance=object! > > is it ok, that when I change PK value and call form.save() it create > new item, and not just update PK value on already existen item if PK > is _not_ AutoField? The primary key identifies which row in the

Re: form.save() allways save data, never update

2008-04-24 Thread sector119
ok I've added instance=object! is it ok, that when I change PK value and call form.save() it create new item, and not just update PK value on already existen item if PK is _not_ AutoField? if it is ok, then how to change value of PK field if it is not AutoField? :) if request.method == 'POS

Re: is_valid() name change?

2008-04-24 Thread Malcolm Tredinnick
On Thu, 2008-04-24 at 03:31 -0700, dimrub wrote: > I don't think having a function with such a profound side effect (such > as making clean_data available) is a good idea. Very counter- > intuitive, IMHO. It's just a name. Changing it now would impact a lot of existing code (and, as I explain be

Re: Getting the user object into a newform

2008-04-24 Thread nickloman
OK I made some progress on this already. class MyForm(forms.Form): def __init__(self, user, data=None): forms.Form.__init__(self, data) self.fields['my_options'] = ModelChoiceField(queryset=SomeModel.objects.get_users_objects(user)) Seems to do what I want. Is this the most

Re: form.save() allways save data, never update

2008-04-24 Thread Malcolm Tredinnick
On Thu, 2008-04-24 at 03:03 -0700, sector119 wrote: > Why this code allways create new objects and never update them!? How > to update objetcs, not create them using form.save() > > Model PK is AutoField. When it not autoincrement field everything > works fine! At no point in your code are you

is_valid() name change?

2008-04-24 Thread dimrub
I don't think having a function with such a profound side effect (such as making clean_data available) is a good idea. Very counter- intuitive, IMHO. Why not split it into two: - validate() - that performs the validation and makes clean_data available - is_valid() - that calls the above validate(

Getting the user object into a newform

2008-04-24 Thread nickloman
Hi there I want to provide a multi-choice field which filters its results according to some external criteria, e.g. the object belongs to a user. I tried something like this: class MyForm(forms.Form): def __init__(self, user): self._user = user my_options = ModelChoiceField(queryset=So

form.save() allways save data, never update

2008-04-24 Thread sector119
Why this code allways create new objects and never update them!? How to update objetcs, not create them using form.save() Model PK is AutoField. When it not autoincrement field everything works fine! class ModelFormClass(ModelForm): class Meta: model = MyModel if req

[OT] Sorry for the "spam" on /community/

2008-04-24 Thread David Larlet
Hi, I'm really sorry for the flood with my blog posts on django community aggregator. I just switch (eventually!) to a django powered blog and totally missed to add an item_pubdate() function to my feeds (silly me). That's fixed now and I hope it'll be updated soon on the planet. I do apol

Django photo application reviewing

2008-04-24 Thread chatchai
I post about photo management application for Django. You can put your comment here. http://meledictas.bashell.com/blog/2008/apr/24/reviewing-django-photo-album/ Regards Chatchai --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Largest django sites?

2008-04-24 Thread Jarek Zgoda
bcurtu napisał(a): > May you enumerate the largest django sites (apart from WSJ)? Do you > know traffic stats of these sites? I'm building a big site, with > potentially lots of traffic and I'm a bit afraid what I can expect... Grono.net (http://grono.net/) is largest Polish community site and i

Re: Search with Stemming, Accents and Entities

2008-04-24 Thread Jarek Zgoda
Rodrigo Culagovski napisał(a): > I am implementing an academic publications database, and am looking > for a search solution. > I need at the very least Stemming and Accented Characters support > (i.e.: searching for "alvarez" returns "álvarez" and v.v.). > Some of the fields have a tinymce edito

Re: Can't get ThreadLocals (user in threadlocal storage) working.

2008-04-24 Thread Hilbert Schraal
Yeah! I found the solution. Instead of: 'XXX.cms.middleware.session.ThreadLocals', I need to do: 'cms.middleware.session.ThreadLocals', So, specify the middleware class without the project name. The strange thing is that the middleware itself works when the project is specified, however t

Re: exclude with ForeignKey

2008-04-24 Thread Kenneth Gonsalves
On 24-Apr-08, at 12:48 PM, Kevin L wrote: > Thanks everyone for the responses, I'm very impressed by the quick > response of the community here ;-) if you want extra-fast responses come to #django on freenode -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/code/ --~

Re: Zero padding an intger in templates

2008-04-24 Thread Matias Surdi
Matias Surdi escribió: > Hi. > > Which is the correct way to zero-pad an integer in templates? is there > any filter? > > Thanks a lot. > > > > > Found it: variable|stringformat:"04i" --~--~-~--~~~---~--~~ You received this message because you are subscri

Re: Zero padding an intger in templates

2008-04-24 Thread Matthias Kestenholz
Hi, On Thu, 2008-04-24 at 09:13 +0200, Matias Surdi wrote: > Hi. > > Which is the correct way to zero-pad an integer in templates? is there > any filter? > Yes: http://www.djangoproject.com/documentation/templates/#stringformat -- http://spinlock.ch/blog/ --~--~-~--~~-

Re: exclude with ForeignKey

2008-04-24 Thread Kevin L
Thanks! This extra nested query is working, although intuitively it seems inefficient when combined with a limit. (I'm not an sql expert though, and in my app it is doing ok for now.) Thanks everyone for the responses, I'm very impressed by the quick response of the community here ;-) On Apr 23,

Zero padding an intger in templates

2008-04-24 Thread Matias Surdi
Hi. Which is the correct way to zero-pad an integer in templates? is there any filter? Thanks a lot. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djan