Re: ManyToMany Question

2006-05-27 Thread Ivan Sagalaev
chrisk wrote: >class Post(models.Model): >... > assoc_cats = models.ManyToManyField(Category) >... > >In my template {% for post in latest %}... works fine, but if i try to >use the Many-to-many related lookup {{ post.assoc_cats.all }} i get an >empty list. > > I wast about to answer somethin

can't edit magic removal wiki page

2006-05-27 Thread Bryan Murdock
I just tried to add this to the magic removal wiki page: And you still might still get errors like this when running `manage.py runserver`: {{{ Validating models... admin.logentry: 'user' has relation with uninstalled model User admin.logentry: 'content_type' has relation with uninstalled model

Re: Templates parameters

2006-05-27 Thread Ivan Sagalaev
Kilian CAVALOTTI wrote: >Currently, I have: >{% for l in list|dictsort:"name" %} >... >{% endfor %} > >I can replace "name" by a variable, but I'd also like to replace 'reversed' by >a variable, to be able to control the sort order from the GET payload. > >Is there a way to achieve this? Or anot

Best way to prepare viewdata for templates?

2006-05-27 Thread Beorn
Hi guys, I've got models like this: class Category(model.Model): pass class City(model.Model): pass class Listing(model.Model): city = model.ForeignKey(City) categories = model.ManyToMany(Category, related_

Re: Class name display when editing inline

2006-05-27 Thread oggie rob
> I'd like to remove the underscore from it. Underscores are not the norm in python class names, but they will still work fine (I think?). In your case, add "verbose_name" and possibly "verbose_name_plural" to your Meta/META class or use CapWords. -rob --~--~-~--~~~---

Re: Class name display when editing inline

2006-05-27 Thread canen
Does the class have a __repr_ method? http://www.djangoproject.com/documentation/models/repr/ --~--~-~--~~~---~--~~ 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@

Re: Encrypted Admin?

2006-05-27 Thread Ian Holsman
I would also set up the apache instance to limit access to the admin pages 's to certain IP ranges. (say of your ISP) On 28/05/2006, at 1:13 PM, James Bennett wrote: > > On 5/27/06, Jay Parlar <[EMAIL PROTECTED]> wrote: >> I'm just wondering what most people do about encrypting their Admin, >>

Re: Encrypted Admin?

2006-05-27 Thread James Bennett
On 5/27/06, Jay Parlar <[EMAIL PROTECTED]> wrote: > I'm just wondering what most people do about encrypting their Admin, > when using Django on a publically viewable server? If the threat of someone sniffing a password is a high-priority issue for a site, the only truly useful solution is to serv

Encrypted Admin?

2006-05-27 Thread Jay Parlar
I'm just wondering what most people do about encrypting their Admin, when using Django on a publically viewable server? For instance, take Jeff Croft's homepage. If I go to http://www2.jeffcroft.com/admin/, I get the standard Djano admin. Maybe it's just me, but it looks like anytime Jeff logs in

Class name display when editing inline

2006-05-27 Thread [EMAIL PROTECTED]
When editing an object in the admin section that allows you to edit its related objects inline, how do you change the text that is displayed above the inline items. It displays the class name and that's ok, but I'd like to remove the underscore from it. --~--~-~--~~~

Re: ManyToMany Question

2006-05-27 Thread Jay Parlar
On 5/27/06, chrisk <[EMAIL PROTECTED]> wrote: > > Hi * > > I'm on trunk and using 'CookBookCategoryDataModelPostMagic'. > > In my models file i have this: > > class Post(models.Model): > ... >assoc_cats = models.ManyToManyField(Category) > ... > > In my template {% for post in latest %}... wor

Directory structure for pluggable apps and projects

2006-05-27 Thread David Montgomery
The tutorial talks about the independence and pluggability of apps and projects, where a project is for a single site. This suggests to me that apps and sites/projects should be in completely separate folders, something like /Django /Apps /myblogapp /myforumapp /Sites

Re: Tagging app

2006-05-27 Thread Luke Plant
On Sunday 28 May 2006 00:22, Ian Holsman wrote: > Hi Luke. > what license is this code under? Oops, forgot to add a LICENSE file. I was going to put it under BSD, same as Django, unless anyone has a compelling reason for anything else, Luke -- "The number you have dialed is imaginary. Plea

Re: Tagging app

2006-05-27 Thread Ian Holsman
Hi Luke. what license is this code under? On 27/05/2006, at 12:03 PM, Luke Plant wrote: > > On Friday 26 May 2006 22:37, Jacob Kaplan-Moss wrote: > >> Looking forward to seeing your code, > > OK, you can now get it here: > > http://files.lukeplant.fastmail.fm/public/python/ > lp_tagging_app_0.

Re: Problems with sites not actually updating I change the code

2006-05-27 Thread oggie rob
> Found out the issue was the fcgi needing to be killed after changes. That's where the dev server is nice... in general its better to develop with the dev server because you don't have to restart -rob --~--~-~--~~~---~--~~ You received this message because you

ManyToMany Question

2006-05-27 Thread chrisk
Hi * I'm on trunk and using 'CookBookCategoryDataModelPostMagic'. In my models file i have this: class Post(models.Model): ... assoc_cats = models.ManyToManyField(Category) ... In my template {% for post in latest %}... works fine, but if i try to use the Many-to-many related lookup {{ post

I'm on the same search about python and IIS (not Django yet)

2006-05-27 Thread [EMAIL PROTECTED]
I am a .NET developer and have an small enterprise too. I want to start a new develpment line in python specially because of its simplisity and high performance. Before i do this i have started a lot of research trying to find out the best way to use it on web develoment which is a very discussed

Re: Related tags ala del.icio.us

2006-05-27 Thread Ivan Sagalaev
Jay Parlar wrote: >Ahh, that's perfect. Is there any way I could use this with the >'object_list' generic view, or will I just have to roll my own view to >get this one going? > Not with the object_list. However you can use object_detail to display a Tag and wrap the query in a custom method of

How to get a model's MultiValueDict

2006-05-27 Thread Christian Schneider
Hi all,the documentation on creating custom views to change a model http://www.djangoproject.com/documentation/forms/ contains the linesif request.POST :    new_data = request.POST.copy()    errors = manipulator.get_validation_errors(new_data)    if not errors:    manipulator.do

Can't call many to many manager

2006-05-27 Thread Christian Schneider
Hi all,in one of my models I haveclass Watchfolder(models.Model):  formats = models.ManyToManyField(Format)  destination = models.ManyToManyField(    Destination,    related_name="WFDestinations",     limit_choices_to={'metadata_destination':False},    blank=True,    validator_list=[destination_val

Re: How to automatically generate a password input field

2006-05-27 Thread Christian Schneider
Steven,thanks but I've already created a custom manipulator. Your approach is noted as I find it very neat. Will use it next time.chrisOn 5/27/06, Steven Armstrong <[EMAIL PROTECTED]> wrote: On 05/27/06 13:23, Christian Schneider wrote:> Hi all,>> can I specify that a certain model field should be

Re: How to automatically generate a password input field

2006-05-27 Thread Steven Armstrong
On 05/27/06 13:23, Christian Schneider wrote: > Hi all, > > can I specify that a certain model field should be displayed as type="password" /> in the UI? > > I think I saw once how to do it but can't find it anymore. > > chris > Hi Chris The following works for me: class PasswordField(mode

Re: Strange "Data too long" error on TextField column on MySQL

2006-05-27 Thread Geert Vanderkelen
Ijonas, Ned, Ned Batchelder wrote: > I've seen this problem too, when inserting non-ascii data into a Windows > MySQL server. There are a few bugs in the MySQL bug tracker about it, > for example: http://bugs.mysql.com/bug.php?id=18908 > We are in the process verifying it. Check last few com

Re: Problems with sites not actually updating I change the code

2006-05-27 Thread [EMAIL PROTECTED]
Found out the issue was the fcgi needing to be killed after changes. --~--~-~--~~~---~--~~ 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 unsubs

Re: How to validate CheckboxField?

2006-05-27 Thread Jorge Gajon
Hi, Yeah it's strange that the CheckboxField doesn't have a validator list. I guess this is worth a ticket. But there's a way to get what you want without passing a validator list. If you define a method "validate_field_name", that method will be called when you call the get_validation_errors() o

Re: Strange "Data too long" error on TextField column on MySQL

2006-05-27 Thread Ned Batchelder
I've seen this problem too, when inserting non-ascii data into a Windows MySQL server. There are a few bugs in the MySQL bug tracker about it, for example: http://bugs.mysql.com/bug.php?id=18908 --Ned. ijonas wrote: > H, > > Checked all my encodings and charset settings and everything see

Re: django.po please try this

2006-05-27 Thread Grigory Fateyev
Hello coulix! On Mon, 15 May 2006 14:37:30 - you wrote: > > Hi i have a weid translation problem > > in setting.py language is fr-fr > in a template foo i do > > {% load i18n %} > then > {% trans "Your name:" %} > {% trans "Jumps to the admin page for pages that represent a single > object

Re: Strange "Data too long" error on TextField column on MySQL

2006-05-27 Thread ijonas
H, Checked all my encodings and charset settings and everything seems to point to "latin1", which is what I would expect... mysql --version: mysql Ver 14.12 Distrib 5.0.18, for Win32 (ia32) Ever stuck, Ijonas. --~--~-~--~~~---~--~~ You received this messag

Problems with sites not actually updating I change the code

2006-05-27 Thread [EMAIL PROTECTED]
Hi, I'm new to both django and python so this may be something simple I'm missing. When I change the code on a file the changes don't seem to reflect in the website. After a while they will show up randomly. Later on I make a change and sometimes the site will revert back to before I made the f

Custom edit_inline class broken?

2006-05-27 Thread [EMAIL PROTECTED]
According to http://code.djangoproject.com/wiki/NewAdminChanges creating a custom variant of the edit_inline form should be possible by creating a class which overrides BoundRelatedObject. I tried this, creating a really silly class which does very little, just to see if I could get it working, bu

Re: Strange "Data too long" error on TextField column on MySQL

2006-05-27 Thread Geert Vanderkelen
Hi Ijonas, ijonas wrote: > Hi, > > I've got a typical blogging app written with the SVN-trunk version of > Django running on MYSQL. I'm importing entries from an old MSSQL > database using DBI. When I create Entry objects and call Entry.save() > an exception is thrown for about 7 out of the 250

Re: How to automatically generate a password input field

2006-05-27 Thread Christian Schneider
Ah, now I get it, I have to write a custom manipulator to use the field, haven't I?Oh well ...On 5/27/06, Kenneth Gonsalves < [EMAIL PROTECTED]> wrote:On Sat, May 27, 2006 4:59 pm, spacedman said: >> just use PasswordField() in your model.>> Might be a recent introduction. Its literally a two-liner

Re: How to automatically generate a password input field

2006-05-27 Thread Kenneth Gonsalves
On Sat, May 27, 2006 5:47 pm, Kenneth Gonsalves said: > > > On Sat, May 27, 2006 4:59 pm, spacedman said: >> >> just use PasswordField() in your model. >> >> Might be a recent introduction. Its literally a two-liner in >> django.forms: >> >> class PasswordField(TextField): >> input_

Re: How to automatically generate a password input field

2006-05-27 Thread Kenneth Gonsalves
On Sat, May 27, 2006 4:59 pm, spacedman said: > > just use PasswordField() in your model. > > Might be a recent introduction. Its literally a two-liner in > django.forms: > > class PasswordField(TextField): > input_type = "password" thats new -- regards kg --~--~-~--~

Re: How to automatically generate a password input field

2006-05-27 Thread Christian Schneider
Except it doesn't work.I now have the following model:class User(models.Model):    passwords_match = validators.AlwaysMatchesOtherField("password", "Passwords don't match.")        shortname = models.CharField(maxlength=200)    firstname = models.CharField(maxlength=200)    lastname  = models.Char

Re: How to automatically generate a password input field

2006-05-27 Thread Christian Schneider
Barry,thanks, it's not in the documentation, yet.I actually tried it but syncdb didn't run correctly, so I changed it along with a mis-spelled EMailField. Should really fix errors one by one.chris On 5/27/06, spacedman <[EMAIL PROTECTED]> wrote: just use PasswordField() in your model.Might be a rec

Re: How to automatically generate a password input field

2006-05-27 Thread spacedman
just use PasswordField() in your model. Might be a recent introduction. Its literally a two-liner in django.forms: class PasswordField(TextField): input_type = "password" http://code.djangoproject.com/browser/django/trunk/django/forms/__init__.py Barry --~--~-~--~

How to automatically generate a password input field

2006-05-27 Thread Christian Schneider
Hi all,can I specify that a certain model field should be displayed as in the UI?I think I saw once how to do it but can't find it anymore.chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. T

Re: Foreign keys in views

2006-05-27 Thread Christian Schneider
Jorge,thanks for your answer. That's what I'm doing now. Unfortunately, I don't have time to dive deeper into CustomManipulators but maybe for the next project.Best regardschris On 5/26/06, Jorge Gajon <[EMAIL PROTECTED]> wrote: Hi,I also found that behavior and what I did was to copynew_data['stat

Strange "Data too long" error on TextField column on MySQL

2006-05-27 Thread ijonas
Hi, I've got a typical blogging app written with the SVN-trunk version of Django running on MYSQL. I'm importing entries from an old MSSQL database using DBI. When I create Entry objects and call Entry.save() an exception is thrown for about 7 out of the 250 odd entries that I'm importing: Excep

Multi-level inline editing (custom)

2006-05-27 Thread [EMAIL PROTECTED]
Hi all I've just started porting one of our in-house applications to Django to see if it can save us some time. We're currently stuck with a horrible Java framework which is an absolute pain to work with, so I'd be very happy to switch. However, if I'm gonna sell that to the bosses, I'll have to