Re: DateTimeField

2006-07-27 Thread PythonistL
jrs, I tried to use {{form.EndTime.time}} and {{form.EndTime.date}} in a form but still NO input field is shown. Do you have any suggestion why? Thank you L --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django u

Re: Lost in forms

2006-07-27 Thread Kenneth Gonsalves
On 27-Jul-06, at 3:49 PM, toth anna wrote: > Can you tell me, is there a way in template to decide > update/create state of the object? i use a hidden field - but i dont know if that is the django way -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ --~--~---

Re: Displaying auto "id" field in Admin

2006-07-27 Thread Carl Holm
Thanks, I have tried this, and have also tried specifying the id column explicitly as a "models.AutoField(primary_key=True)" type, but neither seems to work. CL Julio Nobrega wrote: > Add "id" to your list_display on your model's Admin class, like this: > >class Admin: >list_display = (

Re: Django website: Trac rejects my noble efforts

2006-07-27 Thread Adrian Holovaty
On 7/27/06, yk4ever <[EMAIL PROTECTED]> wrote: > I'm trying to submit a patch for ticket #1030. > > Whatever I type, I always receive Internal Error with message "Akismet > rejected spam". > > The only thing worse than spam is a paranoid spam protection :[ > > Well, what should I do? How to prove

Re: Displaying auto "id" field in Admin

2006-07-27 Thread Julio Nobrega
Add "id" to your list_display on your model's Admin class, like this: class Admin: list_display = ('id', 'some_field', 'other_field') On change pages, no idea how it's done On 7/27/06, CL <[EMAIL PROTECTED]> wrote: > > Hello, > > Does anyone know of an easy way to have the auto gene

Displaying auto "id" field in Admin

2006-07-27 Thread CL
Hello, Does anyone know of an easy way to have the auto generated id field displayed in the Admin feature? Thanks, CL --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s

Re: delete imagefield

2006-07-27 Thread Tamara D. Snyder
Hey, this is great! Thanks a lot, it works great! On Jul 27, 2006, at 7:45 PM, Milton Waddams wrote: > > just had this issue the other day, here's my crude hack. > > stick this in widget/file.html > > {% load admin_modify i18n %}{% if bound_field.original_value %} > {% trans > "Currently:" %}

Showing admin-style forms on regular user forms revisited

2006-07-27 Thread [EMAIL PROTECTED]
Like others, I was very interested in using the clock/calendar widgets in regular pages and found this very helpful: http://groups.google.com/group/django-users/browse_thread/thread/b958a059b6dca44e/67cc4c2f05719a65?lnk=gst&q=admin+calendar&rnum=3#67cc4c2f05719a65 I hit a few snags, though, and t

Re: delete imagefield

2006-07-27 Thread Milton Waddams
just had this issue the other day, here's my crude hack. stick this in widget/file.html {% load admin_modify i18n %}{% if bound_field.original_value %} {% trans "Currently:" %} {{ bound_field.original_value|escape }} [remove] {% trans "Change:" %}{% output_all bound_field.form_fields %} {% els

Re: Template widget size

2006-07-27 Thread Nagy Károly
Malcolm Tredinnick írta: >Sorry, that came across a bit more negatively than I intended: it almost >certainly will be accepted (see the threads linked from the bug). So >it's not a roll of the dice -- the solution isn't ideal, but barring a >better solution, it is a reasonable idea. > > The goa

Re: Template widget size

2006-07-27 Thread Malcolm Tredinnick
On Thu, 2006-07-27 at 16:44 -0700, Malcolm Tredinnick wrote: > On Thu, 2006-07-27 at 17:30 -0600, Jay Klehr wrote: > > Nagy Károly wrote: > > > And Jay, (afaik) CSS controls visual size of field, not the number of > > > characters you can type in (VARCHAR(30) field in 600px input widget > > > mean

Re: Template widget size

2006-07-27 Thread Malcolm Tredinnick
On Thu, 2006-07-27 at 17:30 -0600, Jay Klehr wrote: > Nagy Károly wrote: > > And Jay, (afaik) CSS controls visual size of field, not the number of > > characters you can type in (VARCHAR(30) field in 600px input widget > > means 2/3 of a box is empty) > > > > Charlie. > > > Exactly, the visual

Re: Template widget size

2006-07-27 Thread Jay Klehr
Nagy Károly wrote: > And Jay, (afaik) CSS controls visual size of field, not the number of > characters you can type in (VARCHAR(30) field in 600px input widget > means 2/3 of a box is empty) > > Charlie. > Exactly, the visual size, which is the same as the "size" html attribute, which also ha

Django website: Trac rejects my noble efforts

2006-07-27 Thread yk4ever
I'm trying to submit a patch for ticket #1030. Whatever I type, I always receive Internal Error with message "Akismet rejected spam". The only thing worse than spam is a paranoid spam protection :[ Well, what should I do? How to prove my sincere benevolence to a soulless machine? --~--~--

Re: Template widget size

2006-07-27 Thread Nagy Károly
Matt the Destroyer írta: >size=30 simply tells the browser to make the input field a size of 30 >characters wide. it has no bearing on input data or transmission. > >in the past, i have simply hard-coded my own input fields into my >templates so I can directly control the size and other attribut

Re: FieldDoesNotExist

2006-07-27 Thread Don Arbow
On Jul 27, 2006, at 1:47 PM, Seth Buntin wrote: > > I keep on getting "FieldDoesNotExist" errors. They are saying that a > field, in this case "p", doesn't exist. I don't know what it is > talking about because I am not trying to call "p". Check this: http://code.djangoproject.com/wiki/ Newb

Re: FieldDoesNotExist

2006-07-27 Thread Malcolm Tredinnick
On Thu, 2006-07-27 at 20:47 +, Seth Buntin wrote: > I keep on getting "FieldDoesNotExist" errors. They are saying that a > field, in this case "p", doesn't exist. I don't know what it is > talking about because I am not trying to call "p". My guess would be that you have a field list somewh

Re: Generic views and dates in the future

2006-07-27 Thread Ian Holsman
On 08/07/2006, at 12:12 AM, Jan Claeys wrote:On do, 2006-07-06 at 17:03 -0400, Jay Parlar wrote: On 7/6/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: If I were to write a backwards compatable patch, is it something you'dbe willing to put in? I'm thinking along the lines of a keywordargument 'allow

Re: Batch record processing

2006-07-27 Thread John Lenton
On 7/27/06, Joe <[EMAIL PROTECTED]> wrote: > > You could just strip the path out and get the filename when you extract > the file from the database. Something like: > > def get_file_without_path(self): > start=self.file.rfind('/') > > return self.file[start+1:] um

delete imagefield

2006-07-27 Thread Tamara D. Snyder
I know this has been asked before, but I can't seem to find any helpful answers. I have an imagefield that is not mandatory (blank=True). In the admin, I am able to insert an image, and I can change the image to another one. But I am not able to go back to having no image. Is there a w

Re: Template widget size

2006-07-27 Thread Jay Klehr
Really the "size" of the form field should be controlled by the CSS, and not the hard coded HTML. Though the "maxlength" attribute could be controlled by Django, and tied to the "maxlength" attribute that you define in Model (and it may be in the admin interface, I haven't actually looked mys

FieldDoesNotExist

2006-07-27 Thread Seth Buntin
I keep on getting "FieldDoesNotExist" errors. They are saying that a field, in this case "p", doesn't exist. I don't know what it is talking about because I am not trying to call "p". Any ideas? --~--~-~--~~~---~--~~ You received this message because you are su

Re: How to save file with name based on PK of DB entry

2006-07-27 Thread Joe
You could write a 'save' hook that renames the file and updates the database with this change. Example: class Blog(models.Model): name = models.CharField(maxlength=100) tagline = models.TextField() def save(self): do_something() super(Blog, self).save() # Call the "re

Re: Template widget size

2006-07-27 Thread Matt the Destroyer
size=30 simply tells the browser to make the input field a size of 30 characters wide. it has no bearing on input data or transmission. in the past, i have simply hard-coded my own input fields into my templates so I can directly control the size and other attributes that i might want (such as o

Re: Batch record processing

2006-07-27 Thread Joe
You could just strip the path out and get the filename when you extract the file from the database. Something like: def get_file_without_path(self): start=self.file.rfind('/') return self.file[start+1:] --~--~-~--~~~-

Re: DateTimeField

2006-07-27 Thread jrs
I believe you need 2 fields on your form: {{form.EndTime.time}} and {{form.EndTime.date}} --~--~-~--~~~---~--~~ 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@goog

Re: __str__ concatenation

2006-07-27 Thread Martin Glueck
Seth, the python magic "__str__" function shoud return a string but in your example you returned a tuple consisting of 3 strings. > def __str__(self): > return self.program, " ", self.course_number To return the correct string you should change your code to either: def __str__

__str__ concatenation

2006-07-27 Thread Seth Buntin
I am trying to display this EDU 103 using: def __str__(self): return self.program, " ", self.course_number program (EDU) is a foreign key and 103 is an integer field. I get this: (, ' ', 103L) What do I need to do? If it is a python (not Django) issue just tell me. I am new to py

Re: hide drop-down items with generic views?

2006-07-27 Thread jrs
I have used custom manipulators to do this http://www.djangoproject.com/documentation/forms/ class PollAddManipulator(Poll.AddManipulator): def __init__(self, season): super(Poll.AddManipulator, self).__init__() newfields = [] for field in

Re: Template widget size

2006-07-27 Thread Nagy Károly
patrickk írta: >maxlength is not a size-attribute. >you probably don´t want size=200, just because maxlength is 200. > > Probably. But i don't want "size=30" either. Is "30" hard-wired or reflects to something? Charlie. -- "...s minden mestert kinevettem, ki nem nevetett önmagán." GPG public

Re: DateTimeField

2006-07-27 Thread hotani
Can you get it to show up in the admin area? I've had to reverse engineer several things by digging through the admin area code and applying it to my own stuff. I'm having a similar problem with a date field, I'm just trying to update a date with a hidden field and nothing seems to work. It just

Re: hide drop-down items with generic views?

2006-07-27 Thread hotani
Ok, let me throw out some more info This seems REALLY BASIC, and yet I've spent an embarrassing amount of time trying to figure it out. Unfortunately this has been happening a lot with Django. I'm having problems finding out how to do things I just took for granted with php or cf. Let's say I

Re: Search Engine for Python and Django

2006-07-27 Thread kwe
Kevin, that's great, thanks for the explanation. as an aside, I'm running under OSX so no idea about Windows I'm afraid. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Search Engine for Python and Django

2006-07-27 Thread Kevin
I run django (and Swish-E) under linux so I can't provide any advise on how to compile it for windows. I do run swish-e with the -S prog option and I wrote a python script that reads all of the models from the database and writes out xml (actually html) that corresponds with the values that I'm i

Re: Template widget size

2006-07-27 Thread patrickk
maxlength is not a size-attribute. you probably don´t want size=200, just because maxlength is 200. patrick Am 27.07.2006 um 17:01 schrieb Nagy Károly: > > Is it a desired behaviour of templating system to equalize text input > widgets? > Although in my model two fields are different sizes (max

Template widget size

2006-07-27 Thread Nagy Károly
Is it a desired behaviour of templating system to equalize text input widgets? Although in my model two fields are different sizes (maxlength=20 and maxlength=200), inserting into template it generates with "size=30" tag equally. I can manually control it, but why should i do if it knows everythin

Re: Generic views and dates in the future

2006-07-27 Thread Adrian Holovaty
On 7/6/06, Jay Parlar <[EMAIL PROTECTED]> wrote: > If I were to write a backwards compatable patch, is it something you'd > be willing to put in? I'm thinking along the lines of a keyword > argument 'allow_future' which has a default value of False. Just for the record (and to close this thread),

Re: hiding fields in admin

2006-07-27 Thread Don Arbow
On Jul 27, 2006, at 7:23 AM, sean wrote: > > You should fix those things, editable didn't work because 'False' with > quotes isn't a valid boolean value. Actually 'False' with quotes IS a valid boolean value, just not the expected value. Python evaluates any non-empty string to True. So 'Tru

Re: INSTALLED_APPS partially shown in admin with mod_python

2006-07-27 Thread Kilian CAVALOTTI
> I recently tried to use my django project with apache2+mod_python, after > a developement period using the integrated server. After some struggle, > I finally have a (quite) working installation. But the admin module > shows a really weird quirk. I have two custom applications, listed in > INSTA

Re: Wondering about few 'burried' issues

2006-07-27 Thread Jay Klehr
Sebastian F wrote: > Another issue was with "BooleanFields". I noticed they always hit the > history even if not changed. Someone else had noticed this too and > already posted a ticket (http://code.djangoproject.com/ticket/1511). > Pretty easy to fix but has been open for 4 months? > > These are

Re: hiding fields in admin

2006-07-27 Thread Tamara D. Snyder
Yeah, clearly I followed the wrong tutorial as I was trying to learn things. Ah, well, at least now I *have* learned something. Thanks for the help, everyone. Tamara On Jul 27, 2006, at 9:23 AM, sean wrote: > > You should fix those things, editable didn't work because 'False' with > quotes

DateTimeField

2006-07-27 Thread PythonistL
Is it possible to use a DateTimeField from a model definition as an input field in a form? I have class MyTest(meta.Model): Subject=meta.CharField( maxlength=90) Description=meta.TextField() CurrentBid=meta.IntegerField(maxlength=6,blank=True,null=True) StartTime=meta.Date

Re: Wondering about few 'burried' issues

2006-07-27 Thread Malcolm Tredinnick
On Thu, 2006-07-27 at 03:39 -0700, Sebastian F wrote: > I have been researching few (web) application frameworks and > considering our projects, Django outperforms all of them easily, > reflecting exactly what we were going to build (well, no need to build > now). > > After playing around with so

Re: Strings as filter args

2006-07-27 Thread Chase
Works great. Thanks! --~--~-~--~~~---~--~~ 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 PROT

Re: Strings as filter args

2006-07-27 Thread Martin Glueck
Chase, > I'm trying to dynamically generate filter kwargs (in the form of > strings) and feed them to a QuerySet, but the queryset wants nothing to > do with it. Here's some simplified code: > > name = "joe-smith" > string = "person__slug__exact" > string += "=" + name > > qs = Person.objects.fil

Strings as filter args

2006-07-27 Thread Chase
Hi all I'm trying to dynamically generate filter kwargs (in the form of strings) and feed them to a QuerySet, but the queryset wants nothing to do with it. Here's some simplified code: name = "joe-smith" string = "person__slug__exact" string += "=" + name qs = Person.objects.filter(string) Thi

Re: hiding fields in admin

2006-07-27 Thread sean
You should fix those things, editable didn't work because 'False' with quotes isn't a valid boolean value. The prepopulate is probably not necessary, because all it does is include some javascript that fills the field for you as you edit the other fields. Best just to overrride the save method and

Re: Media and Admin Media URL Issues

2006-07-27 Thread Nebojša Đorđević
On 26 Jul 2006, at 09:37, Tyson Tate wrote: In my project's root, I have my regular media in "media/" and the admin media in "media/admin/". For some reason, I can't access anything under "media/". My server just gives me a 404. Everything under "media/" has 777 permissions. .htaccess: Rewri

Re: hiding fields in admin

2006-07-27 Thread Bill de hÓra
Tamara D. Snyder wrote: > I don't know. My slug field looks like this: > > slug = models.SlugField( >'Slug', >prepopulate_from=("title",), >help_text='Automatically built from the title - do > not fill in yourself.', >

Django and SRU - Search / Retrieve via URL

2006-07-27 Thread Filipe
Anyone used the SRU standard [1] in a Django powered application? I will need to implement a SRU compatible search and was wondering how could it be done. Any thoughts are most welcome. I belive one option would be to write an appropriate urls.py, but that might not be an easy task. I'm guessing

Re: Is MS SQL Server support coming anytime soon?

2006-07-27 Thread Jeremy Dunck
On 7/27/06, Filipe <[EMAIL PROTECTED]> wrote: > > There's a thread I started in the python newsgroup about pymssql but > where were also discussed several other ways to connect to a > MSSqlServer database. I think it contains usefull info on the subject > [1] Yeah, that was outstanding. It leave

Re: hiding fields in admin

2006-07-27 Thread Tamara D. Snyder
I don't know. My slug field looks like this: slug = models.SlugField( 'Slug', prepopulate_from=("title",), help_text='Automatically built from the title - do not fill in yourself.', primary_key='True',

Re: Django and Professional Widgets

2006-07-27 Thread Julio Nobrega
I have a Django site with Dojo, but.. it's not very "integrated". I just call the necessary .js files on my base template and use the functions. There's no talk to Python code and vice-versa, or generators. On 7/27/06, jose <[EMAIL PROTECTED]> wrote: > > Hi all, > > I am going to create a site

Re: Is MS SQL Server support coming anytime soon?

2006-07-27 Thread Joe
We use a scheduled migration from SQL Server to Postgres with a third party app: http://www.sqledit.com/mk/index.html It has to be run on a windows box, but it allows you to do cool things like create a table in the postgres database with the results of a SQL query on the SQL Server database. T

Re: Wondering about few 'burried' issues

2006-07-27 Thread Simon Willison
On 27 Jul 2006, at 11:39, Sebastian F wrote: > But then it hit me, ticket was closed with > resolution 'wontfix' (http://code.djangoproject.com/ticket/2004). I am > curious, why? Your guess is as good as mine - it looks like the ticket was closed by the person who opened it. The Django core d

Re: Is MS SQL Server support coming anytime soon?

2006-07-27 Thread Filipe
There's a thread I started in the python newsgroup about pymssql but where were also discussed several other ways to connect to a MSSqlServer database. I think it contains usefull info on the subject [1] Some days ago someone also pointed out to me Pyodb [2], which might be a good option (althoug

Django and Professional Widgets

2006-07-27 Thread jose
Hi all, I am going to create a site where I need very sofisticated widgets for data presentation. I wonder if anyone have tried to integrate Django with some professional javascript tools like ActiveWidgets, r.a.d controls, dojo, rico, etc. jo --~--~-~--~~~---~

Wondering about few 'burried' issues

2006-07-27 Thread Sebastian F
I have been researching few (web) application frameworks and considering our projects, Django outperforms all of them easily, reflecting exactly what we were going to build (well, no need to build now). After playing around with some test applications I noticed a few things, there wasn't a way to

Auction in Django

2006-07-27 Thread PythonistL
Has anyone tried to implement an auction application in Django? L. --~--~-~--~~~---~--~~ 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 unsubscr

Re: Lost in forms

2006-07-27 Thread toth anna
Kenneth Gonsalves <[EMAIL PROTECTED]> írta: > took me quite a long time to figure things out also Seems there is no easy way. Somehow i digged through myself, so my forms now are working fine. Can you tell me, is there a way in template to decide update/create state of the object? Thanks, Anna

Re: Where can be a problem??

2006-07-27 Thread PythonistL
Chris, Thank you for help L. --~--~-~--~~~---~--~~ 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 [E

Re: generic ModifiedPreorderTreeTraversal app

2006-07-27 Thread nkeric
Cheng Zhang wrote: > Great. > If you get time, I suggest you update the wiki page accordingly. ok, I'll do that soon. plus, a bug fix to the views.py in the node_tree method, the node_list line should add an order_by('lft') to it: node_list = Node.objects.filter(tree_id__exact=root.tree_id, lf

Re: hiding fields in admin

2006-07-27 Thread Sean
That's weird, because it hides it for me. I have a field like this: objects_path = models.CharField(maxlength=50, null=True, editable=False) and it is clearly not visible in the admin. Tamara D. Snyder wrote: > It just makes the field not editable. Actually, it looks like you > can edit the f

Validation questions

2006-07-27 Thread xtian
Hi - I'm building an application in Django, using svn to have the post-magic-removal branch, and I'm using the admin to provide some data setup functionality. I'm having a little trouble with validation of a couple of models in the admin: 1 - I have the following definition of a component: clas

Re: hiding fields in admin

2006-07-27 Thread Bill de hÓra
Tamara D. Snyder wrote: > It just makes the field not editable. Actually, it looks like you > can edit the field - type in new stuff, etc. - but when you hit save, > that field is not saved. This is fine with me, because what I > *really* wanted was to keep knuckleheads from changing the s

Re: Media and Admin Media URL Issues

2006-07-27 Thread SmileyChris
Tyson Tate wrote: > Inefficient and insecure? Blast. I'm using FCGI, so it looks like > I'll have to add a subdomain that points to my media files and, > subsequently, hunt down every single place that I've had to hard-code > the URL in. Hi Tyson Regarding MEDIA_URL, check out that link that Jo

Re: Accessing several databases at once

2006-07-27 Thread John Morton
On Thu, 27 Jul 2006 18:41, James Bennett wrote: > On 7/27/06, John Morton <[EMAIL PROTECTED]> wrote: > > I have an app built who's data (shared lookup tables) is stored in it's > > own database. I want to pull those models into another application to map > > various codes in the second application

Re: Media and Admin Media URL Issues

2006-07-27 Thread Jonathan Buchanan
> Is there a way to avoid hard-coding media URLs? Perhaps there's a > global context variable like: > > picture > > Or some other way to do the equivalent instead of writing custom > views for everything? > > Thanks for the tip. > > -Tyson This article is about writing a custom template context p

Re: Error with InspectDB

2006-07-27 Thread electrolinux
It seems that your AuthMessage table contains invalid values in an integer field. Try to allow NULL values in such field, and replace any empty field with an explicit NULL: update AuthMessage set BadIntegerColumn = NULL WHERE BadIntegerColumn < 0 I've had the very same problem with a mysql db wh

Re: Accessing several databases at once

2006-07-27 Thread Marc Fargas
In case the database is on the same host and technology (mysql, sqlite...) you could create a wrapper view in the databse django uses, to query data on the other database. At least that's what I did until such multi-db branch becomes stable! Cheers,Marc.On 7/27/06, John Morton <[EMAIL PROTECTED]> w