Re: newforms: are FloatField and HiddenField missed yet ?

2007-01-24 Thread ak
Umm please read "complex" as "complete" :) --~--~-~--~~~---~--~~ 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,

Re: newforms: are FloatField and HiddenField missed yet ?

2007-01-24 Thread ak
[EMAIL PROTECTED], either you don't understand me or I don't understand you. > I misspoke earlier. I said you could specify a Select widget for a > CharField to get that output. I don't know if that will actually work > (you could try it) > > field3 = CharField(widget=Select(choices=)) Yes

Re: video uploads (like you tube)

2007-01-24 Thread Waylan Limberg
On 1/24/07, carlwenrich <[EMAIL PROTECTED]> wrote: > > Is there a quick and easy way for users to upload videos the way they > do it on you tube? Is there an example django site that has this > capability? > This should get you started:

Re: video uploads (like you tube)

2007-01-24 Thread James Bennett
On 1/24/07, carlwenrich <[EMAIL PROTECTED]> wrote: > Is there a quick and easy way for users to upload videos the way they > do it on you tube? Is there an example django site that has this > capability? Kindfish is the first example which comes to mind; it's Django-powered and offers video

Re: video uploads (like you tube)

2007-01-24 Thread Jeremy Dunck
On 1/24/07, Justin Johnson <[EMAIL PROTECTED]> wrote: > > > Django really does need stream uploading. IIRC, there's a patch to > do this. > > Does anyone know if that patch is ever going to make it into an > official release? "That patch"? I think you must mean one of the many patches on this

Re: video uploads (like you tube)

2007-01-24 Thread Justin Johnson
Django really does need stream uploading. IIRC, there's a patch to do this. Does anyone know if that patch is ever going to make it into an official release? On 25 Jan 2007, at 02:08, Jeremy Dunck wrote: > > On 1/24/07, Julio Nobrega <[EMAIL PROTECTED]> wrote: >> >> Uploading a video

Re: video uploads (like you tube)

2007-01-24 Thread Jeremy Dunck
On 1/24/07, Julio Nobrega <[EMAIL PROTECTED]> wrote: > > Uploading a video is easy, just use the correct Field from Django. > The real work is converting the video to .flv (Flash Video). I've > never seen a Python module for this job but I bet there's one. Not true if the videos are large

Case study: arbitrarily ordered model objects.

2007-01-24 Thread Balinares
Greetings, I've started playing around with Django, and while I'm quite impressed with it thus far, I've hit a snag that I'm not sure how to overcome. The application I'm working on to get started is an FAQ manager. The FAQs would be listed in the appropriate order, the order being somehow

newforms: MultiValueField and MultiWidget

2007-01-24 Thread canen
Hello All, I am resending this -- seems it didn't reach the last time, sorry if it turns up twice I've been messing around with the new MultiValueField and MultiWidget. I don't know if the shortcoming is with me or with the implementation of the field and widget. Let's say I want

Get FreeComment count on object interactively or in a view?

2007-01-24 Thread [EMAIL PROTECTED]
Hey All, I am wanting to get the free comment count on an object interactively (or in a view - NOT in the template using get_free_comment_count). How can I do this? Basically, I want to sort a queryset by descending number of related comments. Can this be done? Many Thanks, Oliver

Re: video uploads (like you tube)

2007-01-24 Thread Julio Nobrega
Uploading a video is easy, just use the correct Field from Django. The real work is converting the video to .flv (Flash Video). I've never seen a Python module for this job but I bet there's one. I've never uploaded a video to YouTube neither... but I know Flash video players use .flv. On

Re: image doesn't display in template

2007-01-24 Thread wub
I am having the same problem placing an image in a template file. I think you may be farther along than I am, if you understand the 'object.get_mug_shot_url' portion of the instructions. My impression of the Image_File instructions was that they were intended to allow users to send images >to<

video uploads (like you tube)

2007-01-24 Thread carlwenrich
Is there a quick and easy way for users to upload videos the way they do it on you tube? Is there an example django site that has this capability? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re[2]: inspectdb support for ado_mssql?

2007-01-24 Thread Andrew Diederich
Hello Sean, On Wednesday, January 24, 2007, 8:14:11 AM, Sean De La Torre wrote: > Look at this ticket: http://code.djangoproject.com/ticket/2358. More > specifically, use the mssql_update5.diff file - I'm don't think the > anonymously contributed patch after that actually does much. > I

Re: Debugging Django: print statements?

2007-01-24 Thread Filipe Correia
Haven't used pdb yet. 'pdb.set_trace()' would be added on the source code to be debugged, right? Having to change the source code to debug it doesn't feel very right... Filipe On Jan 23, 3:42 pm, "sandro dentella" <[EMAIL PROTECTED]> wrote: > I'd like to stress the first answer was much

Re: newforms: are FloatField and HiddenField missed yet ?

2007-01-24 Thread Rubic
Since Python 2.3 compatibility is an issue, per ticket #3238, here are a couple possibilities: (a) try/except import decimal and fall back to float if decimal is not available. (b) offer separate FloatField and a DecimalField in newforms. I'm -1 on (a) and +0 on (b). I find the

Re: View didn't return an HttpResponse

2007-01-24 Thread Michael Radziej
[EMAIL PROTECTED]: > What would cause an (intermittent) error saying my view didn't return > an HttpResponse object? Perhaps, a missing return in your view function. Or if you try to return directly a string. It gets intermittent if it's only missing/wrong in a seldom used branch. Michael --

Re: Database Error Handling

2007-01-24 Thread Vadim Macagon
Michael Radziej wrote: > That's a good spot. > > It's hard to impossible to catch the error and figure out what the > error message means, since there's no real standard how these error > messages look like. All you got is a string ... > > One way to do this is to lock the table Post before

View didn't return an HttpResponse

2007-01-24 Thread [EMAIL PROTECTED]
What would cause an (intermittent) error saying my view didn't return an HttpResponse object? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: a password field?

2007-01-24 Thread Waylan Limberg
Whoops, sent that too soon. On 1/24/07, Waylan Limberg <[EMAIL PROTECTED]> wrote: > On 1/24/07, medhat <[EMAIL PROTECTED]> wrote: > > > > Hi all, > > > > Ok, here is a question for anybody who might have a quick answer (since > > I can't find it in the documentation, and am too lazy to try to

Re: a password field?

2007-01-24 Thread Waylan Limberg
On 1/24/07, medhat <[EMAIL PROTECTED]> wrote: > > Hi all, > > Ok, here is a question for anybody who might have a quick answer (since > I can't find it in the documentation, and am too lazy to try to find it > in the code :-)) > > Is there an eazy way to add a password field (similar to the one

Re: newforms: are FloatField and HiddenField missed yet ?

2007-01-24 Thread Waylan Limberg
On 1/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Does anyone else have thoughts about a FloatField? > See this ticket: http://code.djangoproject.com/ticket/3238 -- Waylan Limberg [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message

a password field?

2007-01-24 Thread medhat
Hi all, Ok, here is a question for anybody who might have a quick answer (since I can't find it in the documentation, and am too lazy to try to find it in the code :-)) Is there an eazy way to add a password field (similar to the one in the User model) in my model? What I need is a field that I

Re: order_by not working with foreign keys:

2007-01-24 Thread Waylan Limberg
On 1/24/07, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > > Waylan Limberg wrote: > > On 1/24/07, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > >> Book.objects.all().select_related() > >> .order_by('-bookshop_bookstat.avg_rating')[0:10] > >> > > > > You should replace

Re: image doesn't display in template

2007-01-24 Thread [EMAIL PROTECTED]
Compare the path to the image with what Django is putting in. I probably have something set up less than optimally somewhere, but I have to do something like On Jan 24, 10:35 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi group, > > I'm just getting started with Django and I've run

Re: newforms: are FloatField and HiddenField missed yet ?

2007-01-24 Thread [EMAIL PROTECTED]
I misspoke earlier. I said you could specify a Select widget for a CharField to get that output. I don't know if that will actually work (you could try it) field3 = CharField(widget=Select(choices=)) but I'm not sure what it will do since I've never tried it and don't have access to a Python

Re: newforms: are FloatField and HiddenField missed yet ?

2007-01-24 Thread ak
> field1 = CharField(max_length=10, widget=HiddenInput) Thanks :) I've also found another way, but it seems dirty: MyForm.fields['some_field'].widget.input_type = 'hidden' > As for the FloatField, I can't think of any way to get a float value > out of the default clean() method, but you can

Re: newforms: are FloatField and HiddenField missed yet ?

2007-01-24 Thread ak
P.S. I tried: >>> MyForm.fields['some_field'].widget.is_hidden = True but ... >>> MyForm.fields['some_field'].widget.render('a', 'b') u'' --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: newforms: are FloatField and HiddenField missed yet ?

2007-01-24 Thread [EMAIL PROTECTED]
field1 = CharField(max_length=10, widget=HiddenInput) That will create a hidden charfield with max length 10. You may have to put "forms.Charfield(..." depending on how you imported newforms. As for the FloatField, I can't think of any way to get a float value out of the default clean()

image doesn't display in template

2007-01-24 Thread [EMAIL PROTECTED]
Hi group, I'm just getting started with Django and I've run into a snag with images: I've set up the image portion of my site following these directions from the Django FAQ: 1) "In your settings file, define MEDIA_ROOT as the full path to a directory where you'd like Django to store uploaded

Re: newforms: are FloatField and HiddenField missed yet ?

2007-01-24 Thread [EMAIL PROTECTED]
You can change how a field (validator) displays itself by setting the widget kwarg for the field object. Widget is a base argument for a field, so all fields accept it. That would be how to implement the CharField as a select and any other field as a hidden element (hidden isn't really a type

Re: order_by not working with foreign keys:

2007-01-24 Thread Bram - Smartelectronix
Waylan Limberg wrote: > On 1/24/07, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: >> Book.objects.all().select_related() >> .order_by('-bookshop_bookstat.avg_rating')[0:10] >> > > You should replace the dot (.) with a double underscore (__), so: > >

Re: Template with multiple elements and manipulators

2007-01-24 Thread [EMAIL PROTECTED]
I went with the hidden fields, and it works very well. Thanks for your assistance! Vincent On Jan 23, 2:06 pm, "Aidas Bendoraitis" <[EMAIL PROTECTED]> wrote: > 1. You can just have a hidden field defining the manipulator in each form. > > data = request.POST.copy() > if data["hidden_field"] ==

Re: order_by not working with foreign keys:

2007-01-24 Thread Waylan Limberg
On 1/24/07, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > > Book.objects.all().select_related() > .order_by('-bookshop_bookstat.avg_rating')[0:10] > You should replace the dot (.) with a double underscore (__), so:

Re: UnicodeDecodeError with labels of choices (for newforms.ChoiceField with RadioSelect widget)

2007-01-24 Thread [EMAIL PROTECTED]
On Jan 24, 1:03 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Jan 23, 5:41 pm, "Adrian Holovaty" <[EMAIL PROTECTED]> wrote: > > > Would you be willing to test this out in your local copy of Django, > > and report back?Yes, I will try this and report back. If I create a model > >

Re: admin calendar and clock in my code

2007-01-24 Thread Giorgio Salluzzo
Many thanks baxter, I wasn't including all js's needed. On 23 Gen, 15:48, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Giorgio, I included all this: > > > src="/admin_media/js/admin/RelatedObjectLookups.js"> > src="/admin_media/js/calendar.js"> >

Re: inspectdb support for ado_mssql?

2007-01-24 Thread Sean De La Torre
Look at this ticket: http://code.djangoproject.com/ticket/2358. More specifically, use the mssql_update5.difffile - I'm don't think the anonymously contributed patch after that actually does much. I haven't updated it to

Re: Q()s, m2ms and failing queries

2007-01-24 Thread Michael Radziej
Felix Ingram: > Quick reply to myself in case someone is looking through the archives. > This seems to be covered in ticket 1801: > http://code.djangoproject.com/ticket/1801 > > It's noted as a 'hard bug'. I heard you and have put the ticket into "Accepted". If anybody has a solution or can

Re: Cookies on mobile phones NOT to expire at browser close

2007-01-24 Thread Michael Radziej
Adam Fast: > I'm not using cookies for mobiles in any of my apps yet, but I have a > Cingular 8125 and would be willing to help test it out. Nice! I need to slab something together and will come back to you. Michael -- noris network AG - Deutschherrnstraße 15-19 - D-90429 Nürnberg - Tel

Re: Cookies on mobile phones NOT to expire at browser close

2007-01-24 Thread Adam Fast
I'm not using cookies for mobiles in any of my apps yet, but I have a Cingular 8125 and would be willing to help test it out. Adam On 1/24/07, Michael Radziej <[EMAIL PROTECTED]> wrote: > > > Hi, > > for evaluating this ticket, it would be important to get into > contact with anybody using

bug report:cut filter cann't process unicode

2007-01-24 Thread limodou
if a template variable is unicode, and as I using cut filter, it'll throw error, and I checked the source code, I found: def cut(value, arg): "Removes all values of arg from the given string" return value.replace(arg, '') And I also found most filter function have added str() to convert

Re: Q()s, m2ms and failing queries

2007-01-24 Thread Felix Ingram
Quick reply to myself in case someone is looking through the archives. This seems to be covered in ticket 1801: http://code.djangoproject.com/ticket/1801 It's noted as a 'hard bug'. On 16/01/07, Felix Ingram <[EMAIL PROTECTED]> wrote: > Hello all, > > I've run into a problem when trying to add

newforms: UnicodeEncodeError raised when using any non-unicode charset

2007-01-24 Thread ak
Hello again It seems like newforms library has a problem with non unicode charsets yet. For example, I use 'windows-1251' character set for my web apps and MySQL 4.1 with 'cp1251' so actually all data is stored and shown in cp1251. And here's what I get when try to save any form with national

slicing an loops

2007-01-24 Thread Rob Slotboom
Kamil Wdowicz wrote regarding to handling loops: {% for a in list|slice:"1" %} {{ something }} {% endfor %} {% for a in list|slice:"1:3" %} {{ something }} {% endfor %} {% for a in list|slice:"3:" %} {{ something }} {% endfor %} What can be done to fill a table with a given list?

Re: order_by not working with foreign keys:

2007-01-24 Thread Bram - Smartelectronix
Honza Král wrote: >> - >> class Book(models.Model): >> >> >> class BookStat(models.Model): >> book = models.OneToOneField(Song, related_name='stats') >> avg_rating = models.FloatField(max_digits=2,

Re: order_by not working with foreign keys:

2007-01-24 Thread Honza Král
On 1/24/07, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > > Honza Kr�l wrote: > > it occured before on the mailing list... > > > > if you add select_related(), it will work... > > > > the problem is that specifying ordering like this doesn't force the > > join in the query so you might end

Re: Admin site date view and permission controller

2007-01-24 Thread gnijholt
I would like to do this as well, and I have no idea where to start in order to solve the problem in an elegant and DRY way. On Jan 18, 6:26 pm, "Scott Zheng" <[EMAIL PROTECTED]> wrote: > I working on an cms site with django ,I use the admin site too.there is > a departmenttreelike below : > >

Re: currently online users?

2007-01-24 Thread Bram - Smartelectronix
Jeremy Dunck wrote: > > The attached file implements a (lightly-tested) middleware. Wow, thanks a lot! I'll let you know how it goes! - bram --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: order_by not working with foreign keys:

2007-01-24 Thread Bram - Smartelectronix
Honza Král wrote: > it occured before on the mailing list... > > if you add select_related(), it will work... > > the problem is that specifying ordering like this doesn't force the > join in the query so you might end up with a query that sorts on > something that just isn't there... That

Re: UnicodeDecodeError with labels of choices (for newforms.ChoiceField with RadioSelect widget)

2007-01-24 Thread [EMAIL PROTECTED]
On Jan 23, 5:41 pm, "Adrian Holovaty" <[EMAIL PROTECTED]> wrote: > Would you be willing to test this out in your local copy of Django, > and report back? Yes, I will try this and report back. If I create a model instance from a form like so: model = Model(**form.clean_data), I also need to

newforms: are FloatField and HiddenField missed yet ?

2007-01-24 Thread ak
Hello everyone I don't see FloatField and HiddenField field types in newforms. Is it ok ? How to implement then ? And also: oldforms has a nice feature to convert CharField(choices=(...)) to dropdown () with predefined options, newforms displays it as , I think this is not ok. Isn't it ?

Re: Cookies on mobile phones NOT to expire at browser close

2007-01-24 Thread Michael Radziej
Hi, for evaluating this ticket, it would be important to get into contact with anybody using cookies with mobile phones. Anybody, perhaps? Michael -- noris network AG - Deutschherrnstraße 15-19 - D-90429 Nürnberg - Tel +49-911-9352-0 - Fax +49-911-9352-100 http://www.noris.de - The

Re: Database Error Handling

2007-01-24 Thread Michael Radziej
Vadim Macagon: > ... > Let's say I have a Post model with a title field, that title must be > unique for a given date. Here's a sequence of events that could > potentially happen: > > time: t1). User A fills in a form to create a new Post, and sets the > title to "Donkeys". > time: t2). User

Re: newforms & object save

2007-01-24 Thread ak
Wow thanks, it really works as expected I've started to write my own patch already :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: newforms & object save

2007-01-24 Thread [EMAIL PROTECTED]
On Jan 24, 10:12 am, "Honza Král" <[EMAIL PROTECTED]> wrote: > see ticket #3257 > > it is complete patch with tests, the only thing missing is a decision > whether (and potentially how) to add ( "", "-" ) to choices > magically if required is False I believe the ("", "") should go also

Re: newforms & object save

2007-01-24 Thread Honza Král
see ticket #3257 it is complete patch with tests, the only thing missing is a decision whether (and potentially how) to add ( "", "-" ) to choices magically if required is False On 1/24/07, ak <[EMAIL PROTECTED]> wrote: > > Adrian, is there any progress on correct handling of foreign key