Re: ID of the record

2005-12-08 Thread kmh
PythonistL wrote: > Thank you Kieran and Rob for your reply. The reason why I want to know > id of the record is that I would like to name a picture by the id > number( for example the picture will be 4330.jpg if the record id is > 4330) And then the picture is linked with the record data.I wou

Re: Migrating existing data into Django models

2005-12-08 Thread Grigory Fateyev
Hello Jacob Kaplan-Moss! On Tue, 6 Dec 2005 14:16:06 -0600 you wrote: > class Story(meta.Model): > headline = meta.CharField(maxlength=100, primary_key=True) > body = meta.TextField() > > you'll get:: > > CREATE TABLE stories ( > headline va

Re: TimeField Problem/Question

2005-12-08 Thread Robert Wittams
both auto_now and auto_now_add are quite hackish little puppies. auto_now should really be equivalent to a _pre_save that sets the field to the current time. auto_now_add should really be equivalent to a non-editable field that gets set to the current time on insert, and is just statically displ

Re: Adding ManyToMany relationships

2005-12-08 Thread Jason F. McBrayer
On Wed, 2005-12-07 at 05:35 -0800, quentinsf wrote: > OK, I've found the code, and it looks as if set_FOOs() does intelligent > things about only updating the *changes* to the list of object IDs. > I'll use that for now. > > Add and Delete methods would be nice though, as would something that > t

TypeError in _checklogin

2005-12-08 Thread BrandonGoldsworthy
When I try to login to the admin site I get a TypeError : a2b_base64() argument 1 must be string or read-only character buffer, not array.array in django.models.core.Session::get_decoded(), line 83, the value of self.session_data which is being passed to a2b_base64 is array('c', 'KGRwMQpTJ3Rlc3Rj

Re: Django developer position at World Online

2005-12-08 Thread bsoltani
Hah, That would be a cool way to accept applicants. Link them to a faulty url and leave a set of clues pointing to the source code. Whoever fixes the bug can submit and application :) Babak

Re: Migrating existing data into Django models

2005-12-08 Thread tonemcd
What does your auth model look like?

install admin won´t work

2005-12-08 Thread patrick k
when trying to install the admin-table with "django-admin.py install admin" i get the following error: 1050, "Table 'django_admin_log' already exists" but ... that table doesn´t exist. i´m using the current trunk, by the way. patrick

Re: install admin won´t work

2005-12-08 Thread Adrian Holovaty
On 12/8/05, patrick k <[EMAIL PROTECTED]> wrote: > when trying to install the admin-table with "django-admin.py install admin" > i get the following error: > > 1050, "Table 'django_admin_log' already exists" > > but ... that table doesn´t exist. Hmmm, I'm not sure what to say about this other tha

Re: install admin won´t work

2005-12-08 Thread patrick k
django-admin.py init worked ... so the tables are there (not "django_admin_log", i´m sure about that). i already created a superuser. could that be a problem? (i´m still using the dreamhost-wiki for my installation). i also get the login for the admin-interface. when trying to login, i get the er

Re: TimeField Problem/Question

2005-12-08 Thread Brett Hoerner
Robert Wittams wrote: > both auto_now and auto_now_add are quite hackish little puppies. > > auto_now should really be equivalent to a _pre_save that sets the field > to the current time. > > auto_now_add should really be equivalent to a non-editable field that > gets set to the current time on in

Re: install admin won´t work

2005-12-08 Thread Brett Hoerner
What is the value of your DJANGO_SETTING_MODULE environment variable? Is that the same as the project you're working on? Have you checked and double checked the DATABASE_ENGINE and DATABASE_NAME in "YourProject"/settings.py? Do they match the DB you're looking at when you say _log doesn't exist?

Re: Auto-reload is not working

2005-12-08 Thread Brett Hoerner
Are you using a release version or a SVN checkout? I'd be using either (1) the latest SVN checkout, or (2) Release 0.90. The auto-refresh is a 'relatively new' change, so if you're working with an old release or checkout and just now trying it out - it won't be there.

Re: TimeField Problem/Question

2005-12-08 Thread Robert Wittams
Brett Hoerner wrote: > Robert Wittams wrote: > >>both auto_now and auto_now_add are quite hackish little puppies. >> >>auto_now should really be equivalent to a _pre_save that sets the field >>to the current time. >> >>auto_now_add should really be equivalent to a non-editable field that >>gets s

Re: install admin won´t work

2005-12-08 Thread patrick k
i´ve double checked everything. however, i just tried "django-admin.py install admin --settings=cms.settings" and that worked. somehow strange. > What is the value of your DJANGO_SETTING_MODULE environment variable? > Is that the same as the project you're working on? > > Have you checked and

preexisting database

2005-12-08 Thread patrick k
is there any documentation on how to work with a pre-existing database? patrick

Re: preexisting database

2005-12-08 Thread marcos sánchez provencio
http://www.djangoproject.com/documentation/legacy_databases/ patrick k wrote: is there any documentation on how to work with a pre-existing database? patrick

Re: preexisting database

2005-12-08 Thread Eric Walstad
On Thursday 08 December 2005 10:41 am, patrick k wrote: > is there any documentation on how to work with a pre-existing database? Yes:

Re: preexisting database

2005-12-08 Thread patrick k
thanks. didn´t know the word "legacy", so searching was not succesful. > http://www.djangoproject.com/documentation/legacy_databases/ > > patrick k wrote: >> is there any documentation on how to work with a pre-existing database? >> >> patrick >> >> >

Re: TimeField Problem/Question

2005-12-08 Thread Brett Hoerner
> By "insert" I mean the initial creation of a tuple with that id in the > database, not subsequent updates of it. Yeah, sorry, I was thinking "insert" in English, not INSERT as in INSERT vs UPDATE, etc.

Re: install admin won´t work

2005-12-08 Thread Brett Hoerner
Your enviroment variable must be wrong then...

Re: Django developer position at World Online

2005-12-08 Thread Medium
bsoltani wrote: Hah, That would be a cool way to accept applicants. Link them to a faulty url and leave a set of clues pointing to the source code. Whoever fixes the bug can submit and application :) Babak It had better be one interesting bug, else that's a sure way of turning off talen

choices in BooleanField: bug or feature?

2005-12-08 Thread Emanuele
I posted something related some time ago and now I'm back. Don't hate me, you are perfectionist and you should like my way :) Consider the following example that shows the use of 'choices' for some kind of Fields, plus the effect of blank=True: - class Test(meta.Model): c = meta.CharField(

label for foreignkey-relations

2005-12-08 Thread patrick k
is it possible to have different label-names for columns relating to the same foreign table? fragment of my film model: country_1 = meta.ForeignKey(Country) country_2 = meta.ForeignKey(Country) country_3 = meta.ForeignKey(Country) in the admin-interface, i´d like to have different labels for c

Re: TypeError in _checklogin

2005-12-08 Thread BrandonGoldsworthy
Alright, lesson #1: To avoid looking like an idiot, don't try to belt out a mailing list question in 10 minutes before work. array.. not list... duh. So if I change base64.decodestring(self.session_data) to base64.decodestring(self.session_data.tostring()) in django.models.core.Session::get_d

Re: label for foreignkey-relations

2005-12-08 Thread Jacob Kaplan-Moss
Hey Patrick -- The "verbose_name" attribute is what you want:: class MyModel(meta.Model) country_1 = meta.ForeignKey(Country, verbose_name="Country One") country_2 = meta.ForeignKey(Country, verbose_name="Country Two") Jacob

Generic view slug

2005-12-08 Thread Lachlan Cannon
I'm taking a look right now at the generic views list views. I want to show a list of article authors, and then the individual authors. I really want to use a slug (author's name) rather than an id, but rather than being stored in the Author model the name is stored in auth.User which I have a

indexes on tables

2005-12-08 Thread braver
I want to add a UNIQUE() contraint to a table, and create extra indexes on tables. Should I just go ahead and do it in SQL, or there's a python way to specify such extras? Also -- can a ForeignKey be supplied with a human-readable name, like other fields?

Re: choices in BooleanField: bug or feature?

2005-12-08 Thread Adrian Holovaty
On 12/8/05, Emanuele <[EMAIL PROTECTED]> wrote: > BooleanFields behaves differently in admin interface: the field name > name ("Boolean") is not in bold style (not mandatory?) and if you > select the first choice ("You can't select this", as before) you get an > error because there is no validatio

Re: indexes on tables

2005-12-08 Thread Adrian Holovaty
On 12/8/05, braver <[EMAIL PROTECTED]> wrote: > I want to add a UNIQUE() contraint to a table, and create extra > indexes on tables. Should I just go ahead and do it in SQL, or there's > a python way to specify such extras? Add "unique=True" to the appropriate field in your model. Add "db_index=

Re: Easy customizing of admin subsections?

2005-12-08 Thread tonemcd
Whoa, this is very neat... I see the /admin/csv_thing/ URL getting dispatched to (presumably) a method in the target app, - is this correct? If so (big drum roll here), does that mean a method in my_app can get the content of 'result_list' from change_list.html, and work on it to produce the CS