Re: Property overrides

2006-12-11 Thread Adrian Holovaty
On 12/11/06, jerf <[EMAIL PROTECTED]> wrote: > Is there a way to "catch" a property change so I can run some code at > the time? > > Example: > > > class Entry(models.Model): > ... > post_date = models.DateTimeField(...) > posted = models.BooleanField(...) > > e = Entry.create

Problem on Display Image

2006-12-11 Thread wangml
Hi, I meet a problem with ImageField when display the image it contains. I defined an ImageField in myobject like this: attachment = models.ImageField(upload_to='attachments') I set the variables # MEDIA_ROOT = 'c:/myproject/upload' MEDIA_URL = 'http://127.0.0.1:8000/upload' #

Re: mysql MyISAM save woe

2006-12-11 Thread John Morton
On Tuesday 12 December 2006 17:26, Adrian Holovaty wrote: > On 12/11/06, John Morton <[EMAIL PROTECTED]> wrote: > > The database introspection was correctly detecting which field to set as > > the primary key, but failed to detect that that column was > > autoincrementing—it should have assign

Problem with valid(?!) models

2006-12-11 Thread Todd O'Bryan
I'm trying to create a database for multiple choice questions, but I keep getting an error when I try to add answers, both when there are 5 blanks available when I first create a question or when there's only one after I hit save and the error has already reared its ugly head. Basically, I can't g

Problem with streaming uploads - patch # 2070

2006-12-11 Thread jacobm
I am running django rev 3581 with the streaming uploads patch - 3581-streaming_uploads_and_uploadprogress_middleware_x_progress_id.diff. The streaming uploads work great for binary file types, but any time I upload an M3U playlist file (and occassionally with other text files) I get this Attribut

Property overrides

2006-12-11 Thread jerf
I'm writing a review of my Django experience, and there's something I want to fact-check before I complain about it. Is there a way to "catch" a property change so I can run some code at the time? Example: class Entry(models.Model): ... post_date = models.DateTimeField(...)

Re: mysql MyISAM save woe

2006-12-11 Thread Adrian Holovaty
On 12/11/06, John Morton <[EMAIL PROTECTED]> wrote: > On Tuesday 12 December 2006 03:10, John Morton wrote: > > I'm working with an introspected model against tables in a mysql backed > > with the MyISAM engine, and I'm having problems when creating new objects. > > Basically, I instantiate a new

Re: mysql MyISAM save woe

2006-12-11 Thread John Morton
On Tuesday 12 December 2006 03:10, John Morton wrote: > I'm working with an introspected model against tables in a mysql backed > with the MyISAM engine, and I'm having problems when creating new objects. > Basically, I instantiate a new instance of the model, save the new object > with the save

Re: static files

2006-12-11 Thread Jeremy Dunck
On 12/11/06, snippetcreator <[EMAIL PROTECTED]> wrote: > > I have a problem with the development server not serving static files. > I configured everything as explained in static_files.txt (I also have > read all the postings here about the subject) but it still will not > serve images or stylesh

Changemanipulator and follow true

2006-12-11 Thread [EMAIL PROTECTED]
I was hoping someone could tell me if there is a way to do this... I thought using follow and true...it should work..but have been unsuccessful. I have an address object that is tied to a company object: class Address(models.Model): address_id = models.AutoField(primary_key=True) status_

static files

2006-12-11 Thread snippetcreator
I have a problem with the development server not serving static files. I configured everything as explained in static_files.txt (I also have read all the postings here about the subject) but it still will not serve images or stylesheets. The strange thing is I do not get 404's anymore since I co

Get all *_set's from a model?

2006-12-11 Thread Adam Seering
Hi, I have a table (implementing a tree) that a whole lot of other tables have ForeignKeys pointing to. I'm trying to write a "clone" method that takes an element in the table, duplicates it (with a new ID), and creates duplicates of all table elements from any other tables that F

Re: How to integrate existing MySQL data

2006-12-11 Thread Jacob Kaplan-Moss
On 12/11/06 6:43 PM, Dan C wrote: > Ok, have been following along in the Django book and got to the > database chapter. I understand generating the table code and syncing by > defining the models in models.py. But I did things backwards. I created > a database of a few tables that I hoped to use f

How to integrate existing MySQL data

2006-12-11 Thread Dan C
Ok, have been following along in the Django book and got to the database chapter. I understand generating the table code and syncing by defining the models in models.py. But I did things backwards. I created a database of a few tables that I hoped to use for my Django app before thinking about wri

Re: variables within the skeleton template

2006-12-11 Thread Sigurdur Einarsson
templatetags is what I was looking for. I discovered on my way that there needs to be an existing app defined in INSTALLED_APPS with the subdirectory templatetags. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "

Re: Duplicate Related Records

2006-12-11 Thread Ned
Doe'th. Works perfectly now--thank you! On Dec 11, 3:41 pm, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: > Ned wrote: > > ==Template== > > {% for status in form.status %} > > > > > >{{ status.date }}{% if status.date.errors %} > class="error">{{ > > status.date.errors|join:", " }}{%

Re: union of two QuerySets

2006-12-11 Thread Jeremy Dunck
On 12/11/06, Rares Vernica <[EMAIL PROTECTED]> wrote: > > Hi, > > I know the Q way, but actually the filter contains already a lot of Qs. > > I am looking for a way to combine "a" and "b" without going into their > filters. QuerySets are lazy. There's no downside to combining two arbitrarily-com

Re: union of two QuerySets

2006-12-11 Thread Rares Vernica
Hi, I know the Q way, but actually the filter contains already a lot of Qs. I am looking for a way to combine "a" and "b" without going into their filters. Thanks Jacob Kaplan-Moss wrote: > On 12/10/06 9:37 PM, Rares Vernica wrote: >> What is a way to get the union of two QuerySets? > > See

Re: Catching m2m chnages

2006-12-11 Thread coulix
last time i look at it they were no solutions :/ --~--~-~--~~~---~--~~ 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 gro

Re: Duplicate Related Records

2006-12-11 Thread Ivan Sagalaev
Ned wrote: > ==Template== > {% for status in form.status %} > > > {{ status.date }}{% if status.date.errors %} class="error">{{ > status.date.errors|join:", " }}{% endif %} > Somewhere in the first include {{ status.id }}. It's a hidden field that actually different

Duplicate Related Records

2006-12-11 Thread Ned
I have two related tables: class Status(models.Model): permit = models.ForeignKey('Permit', edit_inline=models.TABULAR) date = models.DateField('Date') status = models.ForeignKey(Stage, core=True) class Permit(models.Model): year = models.IntegerField('Permit Year'

Re: Admin CSS files

2006-12-11 Thread patrick k.
sorry, that´s a misunderstanding. the styles are not _part_ of the filebrowser ... Am 11.12.2006 um 19:11 schrieb [EMAIL PROTECTED]: > > Thanks Patrick! > I have used the filebrowser on a couple of projects, but I've never > applied the styles to the rest of my applications. > > Still, It'd be g

Re: manage.py - "test" not a known action - how do I do unittests?

2006-12-11 Thread Don Arbow
On Dec 11, 2006, at 7:48 AM, Bob wrote: > > http://www.djangoproject.com/documentation/testing/ indicates that > unittests can be run with > ./manage.py test > > However, when I run it, "test" is not known as an action. I get this > output: > --- > $ c:/Python24/Python manage.py test

Re: Admin CSS files

2006-12-11 Thread [EMAIL PROTECTED]
Thanks Patrick! I have used the filebrowser on a couple of projects, but I've never applied the styles to the rest of my applications. Still, It'd be great if anyone has created something completely different that they'd like to show off. :) --~--~-~--~~~---~--~~

Re: Query returning all items with no M2M 'to_*_id' relationships

2006-12-11 Thread naitsirhc
Hey everyone, I did a little more digging and came up with a solution by extending the default manager to add a new function 'get_orphans'. When passed a M2M non-symmetrical field, it will do a query and return a query set containing all items which have no parent - ie. any item that does not ap

Re: Cannot resolve keyword 'caption' into field

2006-12-11 Thread [EMAIL PROTECTED]
You define: class MenuItem (models.Model): article = blah blah blah naam = blah blah blah def __str__(self): return self.caption So you're trying to return menuItem.caption, but there is no caption --~--~-~--~~~---~--~~ You received this message

Re: forcing UTF8 data inside django

2006-12-11 Thread Victor Ng
Hi Anton, I don't have mysql5 to test with right now, but I have tested my stuff against sqlite and it seems to work there, so I can't imagine that this will cause you problems on mysql. My usecase is probably like yours - I need multilingual support since I have to handle names of countries and

Re: forcing UTF8 data inside django

2006-12-11 Thread Victor Ng
Hi Gabor, First off, I just realized that the code I posted earlier has a small bug. Line 17 should've read: 17 for key, vallist in cgiargs.lists(): the old code used 'items()' which only pulls a single value out of multivaluedict. On to unicode The reason I'm paranoid ab

Re: Customising Admin

2006-12-11 Thread spako
thanks for that, it permissions did the tricks. the editable=False does not do what i require, i want the administrator to be able to view fields but not edit them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

manage.py - "test" not a known action - how do I do unittests?

2006-12-11 Thread Bob
http://www.djangoproject.com/documentation/testing/ indicates that unittests can be run with ./manage.py test However, when I run it, "test" is not known as an action. I get this output: --- $ c:/Python24/Python manage.py test Error: Your action, 'test', was invalid. Run "manage.py -

Re: filter by related record

2006-12-11 Thread Rory Campbell-Lange
Hi Russell I'm very grateful for your advice; its now working. Many thanks Rory On 08/12/06, Russell Keith-Magee ([EMAIL PROTECTED]) wrote: > On 12/8/06, Rory Campbell-Lange <[EMAIL PROTECTED]> wrote: > Your SiteEnergy model doesn't have an 'energy' field. The relation > with the Energy model

Re: Customising Admin

2006-12-11 Thread patrick k.
Am 11.12.2006 um 16:20 schrieb spako: > > i'm using django.contrib.admin for the cms of the site i am building. > > there are a bunch of things i want to do with the cms that i think > might be possible, i've just not found much documentation for this > addon, these things include: > > * replaci

Projects in Postgres

2006-12-11 Thread Doug Van Horn
I have a quick 'Opinion Poll' question regarding how to use Postgres with Django. I'm set up over at Rimu Hosting [http://www.rimuhosting.com/] and I'm going to have my first 'client' up and running soon. I have my own site running against Postgres, plus I'll be installing some demo sites that w

Customising Admin

2006-12-11 Thread spako
i'm using django.contrib.admin for the cms of the site i am building. there are a bunch of things i want to do with the cms that i think might be possible, i've just not found much documentation for this addon, these things include: * replacing a field's output in edit view to what i want (i.e.

Re: Admin CSS files

2006-12-11 Thread patrick k.
it´s not really a different style. it´s more a cleanup of smaller issues (like date/time-fields, edit_inline ...). generally, a cleaner look (in my view) because stuff is in grid. some screenshots are here: http://trac.dedhost-sil-076.sil.at/trac/filebrowser/wiki patrick Am 11.12.2006 um 13:5

Re: Sitemaps and pagination

2006-12-11 Thread [EMAIL PROTECTED]
Personally, I think you're overthinking it, and only mapping the starting point for each topic is the appropriate (and expected) behavior. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To po

Admin CSS files

2006-12-11 Thread [EMAIL PROTECTED]
Hi there! I was just wondering if anyone here has made any custom styles for the admin site. I'd love to see a different style on the admin, but I don't have the time nor the possibility to create something which looks good. So, does anyone feel like sharing a custom css, if it's been created? :

Catching m2m chnages

2006-12-11 Thread Ivan Sagalaev
Hello! I have two models linked through m2m relation. I want to hook a code that will be executed on each change in this relation (adding and removing). If it wasn't about m2m then I would just override a save() method of a model but with m2m an intermediate table is not represented as a mode

mysql MyISAM save woe

2006-12-11 Thread John Morton
I'm working with an introspected model against tables in a mysql backed with the MyISAM engine, and I'm having problems when creating new objects. Basically, I instantiate a new instance of the model, save the new object with the save method, then test the primary key attribute. Except that th

TextField and mysql text columns

2006-12-11 Thread John Morton
I've got a model built out of a database introspection on a mysql MyISAM table which has a 'text' column which maps to a TextField. The problem is that this field ends up being an array object of characters, rather than just a string, as I expected. Is this behaviour consistant for all TextFie

Re: Schema Evolution code

2006-12-11 Thread Jeremy Dunck
On 12/10/06, Victor Ng <[EMAIL PROTECTED]> wrote: > > Hi Russ, > > I've got a rough version of schema evolution working now. ... > I honestly think it's a *bad* solution to the problem. I've been > looking at sqlalchemy and the 'migrate' project : The attached file is in no way a complete soluti

Re: variables within the skeleton template

2006-12-11 Thread Guillermo Fernandez Castellanos
Maybe middleware is what you are thinking of: http://www.djangoproject.com/documentation/middleware/ G On 12/11/06, Sigurdur Einarsson <[EMAIL PROTECTED]> wrote: > > Hello group, > > How can a call variables, objects, attributes within the skeleton > template. > > For example if I would like a d

Re: cyrillic text garbled if used as question in polls example

2006-12-11 Thread Anton Daneika
Thank you for support :) It helps to keep myself up. On 12/11/06, Gábor Farkas <[EMAIL PROTECTED]> wrote: > > > Anton Daneika wrote: > > Well, I tried this conf modification. > > Before it I could do > > mysql> insert into polls_poll (`question`, `pub_date`) values ('Часто > > ли у вас возникают

Re: cyrillic text garbled if used as question in polls example

2006-12-11 Thread Gábor Farkas
Anton Daneika wrote: > Well, I tried this conf modification. > Before it I could do > mysql> insert into polls_poll (`question`, `pub_date`) values ('Часто > ли у вас возникают проблемы с кирилицей?', NOW()); > > Then the select statement would produce a correct cyrillic output, but > after th

Re: cyrillic text garbled if used as question in polls example

2006-12-11 Thread Anton Daneika
On 12/11/06, Georgi Stanojevski <[EMAIL PROTECTED]> wrote: > > > Anton Daneika напиша: > > > playing with example polls application. This resulted in a bunch of > question > > marks on the view page, instead of the expected "Как дела?" poll > question, > > which was in Cyrillic. > > My firefox char

Re: forcing UTF8 data inside django

2006-12-11 Thread Gábor Farkas
Victor Ng wrote: > Hi all, > > The unicode problem seems to creep up in this list a lot, so here's > what I've done to solve my problems. > > My particular problem is that I need to be able to deal with Unicode > data in the URLs as well as the regular request GET/POST data. > > This is a piece

variables within the skeleton template

2006-12-11 Thread Sigurdur Einarsson
Hello group, How can a call variables, objects, attributes within the skeleton template. For example if I would like a dynamic menu or a login status to be displayed in the skeleton template, every time it is called to work. I've found out that attributes and objects are also accessible by the

Re: generic and message

2006-12-11 Thread sedat
Very nice. Thank you. --~--~-~--~~~---~--~~ 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, send email to [EMAIL PR

Re: cyrillic text garbled if used as question in polls example

2006-12-11 Thread Georgi Stanojevski
Anton Daneika напиша: > playing with example polls application. This resulted in a bunch of question > marks on the view page, instead of the expected "Как дела?" poll question, > which was in Cyrillic. > My firefox character encoding is set to UTF-8; > the following command: > $ env | grep -i ut

Re: cyrillic text garbled if used as question in polls example

2006-12-11 Thread Mikhail Gusarov
You ([EMAIL PROTECTED]) wrote: m> then I tried to ran the following SQL: mysql>> insert into polls_poll (`question`, `pub_date`) values ('Ты m> используешь Джанго?', NOW()); m> now it's displayed ok in the mysql client, but the admin interface m> shows a different style garbled text instead

Re: Re: generic and message

2006-12-11 Thread James Bennett
On 12/11/06, sedat <[EMAIL PROTECTED]> wrote: > The message will not be that simple. It would include the saved or > updated object.And I want to show it on the main page that normally not > include a message. Look at how the comments application does this; it passes the contenttype ID and object

Re: Cannot resolve keyword 'caption' into field

2006-12-11 Thread Rob Slotboom
On 10 dec, 17:42, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > What is the error you are getting? It's the 'subject' Cannot resolve keyword 'caption' into field --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: generic and message

2006-12-11 Thread sedat
The message will not be that simple. It would include the saved or updated object.And I want to show it on the main page that normally not include a message. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: Re: generic and message

2006-12-11 Thread James Bennett
On 12/11/06, sedat <[EMAIL PROTECTED]> wrote: > Nope. > Authentication is not an issue yet. > It is just an anonymous user adding info to system. > By the way I think I am misunderstood.I am giving a post_save_redirect > url. In this url I want to add a message."It is ok " or "It is not ok" I thi

Re: forcing UTF8 data inside django

2006-12-11 Thread mezhaka
On Dec 11, 6:02 am, "Victor Ng" <[EMAIL PROTECTED]> wrote: > Hi all, > > The unicode problem seems to creep up in this list a lot, so here's > what I've done to solve my problems. > > My particular problem is that I need to be able to deal with Unicode > data in the URLs as well as the regular req

Re: cyrillic text garbled if used as question in polls example

2006-12-11 Thread mezhaka
On Dec 9, 11:25 pm, Baurzhan Ismagulov <[EMAIL PROTECTED]> wrote: > Hello Anton, > > On Sat, Dec 09, 2006 at 08:49:25PM +0200, Anton Daneika wrote: > > I tried entering a Cyrillic text for the poll question attribute, while > > playing with example polls application. This resulted in a bunch of qu

Re: How to change the representation of newline?

2006-12-11 Thread Aidas Bendoraitis
It seems that your browser treats new lines as under dos/windows. Is it Konqueror? I would suggest you to override the save method of your model, replacing new line characters to the preferred format: class MyModel(models.Model): body_text = models.TextField() ... def save(self):

Re: generic and message

2006-12-11 Thread sedat
Nope. Authentication is not an issue yet. It is just an anonymous user adding info to system. By the way I think I am misunderstood.I am giving a post_save_redirect url. In this url I want to add a message."It is ok " or "It is not ok" --~--~-~--~~~---~--~~ You r

Re: generic and message

2006-12-11 Thread Jonathan Buchanan
On 12/11/06, sedat <[EMAIL PROTECTED]> wrote: > > Hi, > I am trying to show a message as a result of create,update or deletion > of an object by generic. > How can I do that? I mean As far as I know I can give a > post_save_redirect url but I want to show a message also like 'Object X > saved succ

generic and message

2006-12-11 Thread sedat
Hi, I am trying to show a message as a result of create,update or deletion of an object by generic. How can I do that? I mean As far as I know I can give a post_save_redirect url but I want to show a message also like 'Object X saved successfully'. --~--~-~--~~~---~--

Sitemaps and pagination

2006-12-11 Thread Maciej Bliziński
Hello Djangoers, I'm writing a sitemap for a forum. The forum's model is standard: there are topics which have posts. When viewing a topic, posts are paginated: /forum/topics/12/how-are-you/ /forum/topics/12/how-are-you/page2/ /forum/topics/12/how-are-you/page3/ ...and so forth. In the standard

Re: How to restrict, in "delete confirmation", the affected objects list?

2006-12-11 Thread Mario Graziosi
Jorge, thank you very much! Both for the detailed explanation and for the time you spent answering. I'll surely follow your guidelines for the "clean" solution. Jorge Gajon wrote: > On 12/9/06, Mario Graziosi <[EMAIL PROTECTED]> wrote: > >> Is it possible to restrict the list of "would be d