Re: Filtering generic view querysets with URLconf named groups

2008-07-16 Thread Malcolm Tredinnick
On Wed, 2008-07-16 at 22:31 -0700, Justin Myers wrote: > Hey there. I'm starting a term as web development editor at my student > newspaper in the fall, and we recently (February) launched a new site > created in Django. My background's definitely more in design than in > development per se, so

Filtering generic view querysets with URLconf named groups

2008-07-16 Thread Justin Myers
Hey there. I'm starting a term as web development editor at my student newspaper in the fall, and we recently (February) launched a new site created in Django. My background's definitely more in design than in development per se, so I'm trying to get up to speed with Django by putting together a

how to set CharField default value to logged in admin user?

2008-07-16 Thread Gue
I wanted set CharField default value to logged in admin user in model. and i have no idea about this. :( please, Is there any documentation or tip could be reference? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

post-save hook in newforms-admin

2008-07-16 Thread Wanrong Lin
Hi, I just switched to the newforms-admin branch. After some tweaking, things worked fine. But the real reason I switched is because I want to use the post-save hook in the new admin application. To be more specific, I want to perform some processing on a database entry after it is added or

Re: Faking out mod_python

2008-07-16 Thread Graham Dumpleton
On Jul 17, 5:24 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > We're running a production setup with nginx running in front of > apaches runningmod_python. Nginx is decoding all ssl and reverse > proxying (the decrypted requests) to apache on the backend. We > recently upgradedmod_pythonand

request getlist() in order?

2008-07-16 Thread Rob Hudson
If I have a form like the example: The Beatles The Who The Zombies And I call request.POST.getlist('bands'), is the order of the bands going to always be the same as provided in the select box? Or another case, if I have the form: Select bands in the order you want them to

Re: Django vs. Kohana

2008-07-16 Thread [EMAIL PROTECTED]
Henrik Bechmann napisał(a): > Can anyone with experience or knowledge of both Django and Kohana (PHP > framework, son of CodeIgniter) list contexts in which each would be > most appropriate? I'm in a selection process right now with both on > the short list. > > Thanks! > > - Henrik Django is

Re: vanilla login_required decorator not strict enough to rely on?

2008-07-16 Thread Egon Esser
Right now I'd just like to know if there is anyone at all anymore that wrote a custom/extended login_required decorator and what type of extension and the exact need for it (motivation) was. Thx, folks! --~--~-~--~~~---~--~~ You received this message because you

Django vs. Kohana

2008-07-16 Thread Henrik Bechmann
Can anyone with experience or knowledge of both Django and Kohana (PHP framework, son of CodeIgniter) list contexts in which each would be most appropriate? I'm in a selection process right now with both on the short list. Thanks! - Henrik --~--~-~--~~~---~--~~

Re: OpenID support in contrib.auth

2008-07-16 Thread [EMAIL PROTECTED]
django-openid by simon willson works, but you probably have to use the openid-2.0+auth branch. I used it in my Diamanda (http:// code.google.com/p/diamanda/) and it works ;) (diamandas.userpanel app). I've also added authentication manager for loggin to a django user if it has assigned openID

display related model data in nfa add/modify view?

2008-07-16 Thread smcoll
i have created a UserProfile model to extend the User. i'd like to show the 'first_name', 'last_name', and 'email' fields from the User model in the UserProfile admin change view, with a link to change the User record. How can this be done using the latest newforms-admin branch? i can't inline

OpenID support in contrib.auth

2008-07-16 Thread Jon Brisbin
I tried both OpenID integration packages I could find for Django and couldn't get either to integrate in what I felt like was a clean manner (or even get them to work!). I've resolved to simply write my own, stripped-down version of an Auth backend that uses OpenID (additionally storing

Re: tree structured data

2008-07-16 Thread Marc Vinyes
thanks Frantisek, Rusell and Oscar a lot for your tips! --~--~-~--~~~---~--~~ 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

Dynamic upload_to for ImageField in newforms admin?

2008-07-16 Thread Brandon Taylor
Hi everyone, I'm following this tutorial for specifying a dynamic "upload_to" attribute: http://scottbarnham.com/blog/2007/07/31/uploading-images-to-a-dynamic-path-with-django/ But, it doesn't seem to want to work with Django admin. Does anyone have any experience tweeking this custom class to

Re: ModelForm subclass and overriding __init__()

2008-07-16 Thread keseph
Look at line 79-84 in django/newforms.py (the default __init__). The very first thing you should (usually) do in __init__ is init your parent form class so that it sets up this current instance of the Form properly. You can then add (or remove) any dynamic fields you want to in self.fields.

Re: ImageFiled Uploads

2008-07-16 Thread Marty Alchin
On Wed, Jul 16, 2008 at 2:50 PM, d3f3nd3r <[EMAIL PROTECTED]> wrote: > hello, > I have another problem with file upload. > request.FILES['file'] represents a dictionary in my view, not an object. > > Here is my code : >class UserPicForm(forms.Form): >userpic =

Faking out mod_python

2008-07-16 Thread [EMAIL PROTECTED]
We're running a production setup with nginx running in front of apaches running mod_python. Nginx is decoding all ssl and reverse proxying (the decrypted requests) to apache on the backend. We recently upgraded mod_python and are now running into an issue because of this django code... def

Re: ImageFiled Uploads

2008-07-16 Thread Molly
Sorry, i'm still new to programming in general so I'm not familiar with that.. Wish i could help.. Good luck, Molly On Jul 16, 2:50 pm, d3f3nd3r <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Molly wrote: > > Also, make sure you import ImageField at the top:

Re: single list items in templates

2008-07-16 Thread Ahmad Akkaoui
That simple huh, don't know why I didn't try that... Thanks! On Wed, 2008-07-16 at 14:03 -0500, Tim Chase wrote: > > I have a list: data = ['apple', 'orange', 'banana'] > > in my template: {{ data }} will output: ['apple', orange, banana] > > but {{ data[0] }} will throw an error > > > {{

Re: single list items in templates

2008-07-16 Thread Tim Chase
> I have a list: data = ['apple', 'orange', 'banana'] > in my template: {{ data }} will output: ['apple', orange, banana] > but {{ data[0] }} will throw an error {{ data.0 }} should do the trick. -tim --~--~-~--~~~---~--~~ You received this message because

single list items in templates

2008-07-16 Thread Ahmad Akkaoui
Hello everyone! I have a list: data = ['apple', 'orange', 'banana'] in my template: {{ data }} will output: ['apple', orange, banana] but {{ data[0] }} will throw an error how can I print single entries at will in a template instead of the whole list? Thanks!

ModelForm subclass and overriding __init__()

2008-07-16 Thread Eric Montgomery
I am using newforms-admin to add custom validation for a Calendar app. I am trying to handle recurring events by displaying extra fields in the EventForm when creating a new event, but then disabling those fields for already-existing events. I overrode ModelForm's __init__ to achieve this by

Re: ImageFiled Uploads

2008-07-16 Thread d3f3nd3r
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Molly wrote: > Also, make sure you import ImageField at the top: > > from django.db.models import ImageField > > And, do you have the PIL downloaded?? > Did you import Image? > hello, I have another problem with file upload. request.FILES['file']

Re: Turning on mod_python in Apache does not allow non-Django pages to rendor correctly

2008-07-16 Thread Karen Tracey
On Wed, Jul 16, 2008 at 1:49 PM, danielk <[EMAIL PROTECTED]> wrote: > > On Jul 16, 12:03 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > > On Wed, Jul 16, 2008 at 10:51 AM, danielk <[EMAIL PROTECTED]> > wrote: > > > > > I've been doing things with PHP (and phpDocumentor) and recently > > >

Re: Quick question about switching to newforms-admin branch....

2008-07-16 Thread Jashugan
On Jul 16, 6:19 am, Dan <[EMAIL PROTECTED]> wrote: > I'm starting the project in two weeks, hopefully, it will be merge then. Don't worry about it being merged with trunk. From what I understand changes from trunk are merged into newforms-admin branch on a weekly basis (that is, if they are

Django events during OSCON

2008-07-16 Thread Michael Richardson
Hi everyone! Next week is OSCON in Portland, Oregon. For anybody attending OSCON, or anybody who's going to be in the greater Portland metropolitan area, here's a lineup of Django-related events: 1. Tuesday, July 22, 7pm, Jax Bar: Django Drinkup! Come meet other Djangonauts from OSCON and

Re: accessing an attribute for the first item in a template context

2008-07-16 Thread Norman Harman
Hani wrote: > Hi, > > I'm a newbie and am having a an issue accessing the attribute for a > variable. I did a search (django documentation and here) and found > nothing. If this has been covered before, please direct me to the > correct thread. > > I currently pass a context to my template and

Re: Many to many array accessible from template?

2008-07-16 Thread Jashugan
On Jul 13, 6:10 am, Darthmahon <[EMAIL PROTECTED]> wrote: > Alex, > > I don't understand what you mean by that? message.users.all prints out > a list of users based on the many to many. I just want to check if the > current user is in message.users.all - are you saying I can't because > I am

Re: Modulo of 4 not working right

2008-07-16 Thread Arien
On Wed, Jul 16, 2008 at 11:01 AM, Marty Alchin <[EMAIL PROTECTED]> wrote: > Of course, you're welcome to go with Scott's suggestion of doing all > the math in one line, but it loses a bit readability going that way. > On the flip side, it probably executes slightly faster, but probably > not

Re: ImageFiled Uploads

2008-07-16 Thread Norman Harman
Dane Hesseldahl wrote: > How do I get to the image when the avatar field has an image uploaded > through it? http://www.djangoproject.com/documentation/upload_handling/ -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman

Re: Turning on mod_python in Apache does not allow non-Django pages to rendor correctly

2008-07-16 Thread danielk
On Jul 16, 12:03 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Wed, Jul 16, 2008 at 10:51 AM, danielk <[EMAIL PROTECTED]> wrote: > > > I've been doing things with PHP (and phpDocumentor) and recently > > started looking into Django. > > > I now have the following in my 'httpd.conf' file: > >

Re: Change form - populating selected item from a ForeignKey field?

2008-07-16 Thread Rajesh Dhawan
On Jul 16, 10:52 am, mbdtsmh <[EMAIL PROTECTED]> wrote: > Thanks Rajesh - this works perfectly! > > I now have another question... > > What do I now do about manytomany fields for example look at the > contributor field in the example below - I want the current > contributors to be selected in

Re: ImageFiled Uploads

2008-07-16 Thread Molly
Also, make sure you import ImageField at the top: from django.db.models import ImageField And, do you have the PIL downloaded?? Did you import Image? On Jul 16, 1:42 pm, Molly <[EMAIL PROTECTED]> wrote: > Dane: > > You need to make a path where your images will go. > > For example: > > avatar

Re: ImageFiled Uploads

2008-07-16 Thread Molly
Dane: You need to make a path where your images will go. For example: avatar = forms.ImageField(upload_to='media/images', required=False) **I'm not sure what that label='Change Profile Image' is that you are doing.. Also, your MEDIA_URL needs to be: MEDIA_URL='/media/' Hope that makes

Re: [i18n] How to switch/force a language from inside a usual view function?

2008-07-16 Thread Malcolm Tredinnick
On Wed, 2008-07-16 at 10:27 -0700, Valery wrote: > Hi all, > > I would like to force a translation language according to URI- > parameter. Something similar is done here: > http://www.jondesign.net/articles/2006/jul/02/langue-depuis-url-django-url-locale-middleware/#thecode > > but it is done

[i18n] How to switch/force a language from inside a usual view function?

2008-07-16 Thread Valery
Hi all, I would like to force a translation language according to URI- parameter. Something similar is done here: http://www.jondesign.net/articles/2006/jul/02/langue-depuis-url-django-url-locale-middleware/#thecode but it is done there on the middleware level. In my case a decision about

Re: multiple one-to-one relationships

2008-07-16 Thread Eric Abrahamsen
> As documented in the backwards-incompatibility notes from the > queryset-refactor merge, OneToOneFields in (existing) admin are not > supported. They didn't work before the qsrf merge reliably, either, so > no functionality was lost in the process. Sweet, I'm switching to nf-ad. Thanks a lot.

Re: multiple one-to-one relationships

2008-07-16 Thread Malcolm Tredinnick
On Wed, 2008-07-16 at 22:35 +0800, Eric Abrahamsen wrote: > > Saving how, exactly? If admin, newforms-admin or old admin? If old > > admin, have you tried it on newforms-admin -- bugs in old admin are > > unlikely to get any attention at this point. If saving in your own > > code, more

Re: Modulo of 4 not working right

2008-07-16 Thread Ned Batchelder
People here are right: remove the "not". You want to keep adding blanks until the total length is zero mod 4. Then, at line 19 in the dpaste, change the loop to: for blank in range(amountofblanks). You shouldn't be subtracting one from the value there. --Ned. http://nedbatchelder.com

ImageFiled Uploads

2008-07-16 Thread Dane Hesseldahl
Hey guys, I can't seem to find a good resource for the best way to handle this, so I thought I'd ask. What is the best way to handle an upload through an ImageField in a custom form? For example: class ProfileForm(forms.Form): first_name = forms.CharField(label='First Name',

Re: Modules Imported Multiple Times

2008-07-16 Thread Michael Glassford
Malcolm Tredinnick wrote: > > On Mon, 2008-07-14 at 23:30 -0700, django-m712 wrote: > [...] >> Has anyone else experienced this problem? > > There are a few places in Django where we need to access all the models > in an app, for example. So we use __import__(), since that's the safest > way to

accessing an attribute for the first item in a template context

2008-07-16 Thread Hani
Hi, I'm a newbie and am having a an issue accessing the attribute for a variable. I did a search (django documentation and here) and found nothing. If this has been covered before, please direct me to the correct thread. I currently pass a context to my template and it works fine. For example,

Re: Turning on mod_python in Apache does not allow non-Django pages to rendor correctly

2008-07-16 Thread Karen Tracey
On Wed, Jul 16, 2008 at 10:51 AM, danielk <[EMAIL PROTECTED]> wrote: > > I've been doing things with PHP (and phpDocumentor) and recently > started looking into Django. > > I now have the following in my 'httpd.conf' file: > > LoadModule python_module "C:/Progra~1/Apache~1/Apache2.2/modules/ >

Re: Modulo of 4 not working right

2008-07-16 Thread Marty Alchin
On Wed, Jul 16, 2008 at 11:46 AM, Joshua Jonah <[EMAIL PROTECTED]> wrote: > Yeah, but the point is to make the list exactly divisible, is there a > better way to do this? I'm then taking the number of fields and dividing > them by four, then outputting that number of items in each column. I

Re: How to deal with two distinct UserProfile model ?

2008-07-16 Thread Norman Harman
Hades_L wrote: > Hello, > I'm having trouble dealing with User module. In my application, I have > two types of users who should be able to log in. > The first one is an Employee, so I have a code like this: > class Employee(models.Model): >someFields = ... >... >user =

Re: Modulo of 4 not working right

2008-07-16 Thread Joshua Jonah
Yeah, but the point is to make the list exactly divisible, is there a better way to do this? I'm then taking the number of fields and dividing them by four, then outputting that number of items in each column. > The 'simple fix', to remove 'not' from the statement works because of > how

Re: How do I know, in a unit test, the user authenticated after login?

2008-07-16 Thread Norman Harman
Florencio Cano wrote: > Hi, > I would like to know how I can retrieve the user id of the user > authenticated in the auth subsystem after login in a test. > > class CrearCarteraTestCase(TestCase): > fixtures = ['/fixtures/initial_data.xml'] > > def setUp(self): >

Re: Take an integer and string and make one string

2008-07-16 Thread Molly
Awesome, thanks a lot guys, that solved it :) On Jul 16, 11:24 am, "Colin Bean" <[EMAIL PROTECTED]> wrote: > Format strings are your friend: > > "%s: %d" % (self.consequence, self.slope_height_rr) > > Colin > > On Wed, Jul 16, 2008 at 8:14 AM, Molly <[EMAIL PROTECTED]> wrote: > > > I am trying

Re: Modulo of 4 not working right

2008-07-16 Thread Jeff Anderson
Joshua Jonah wrote: I'm not sure how to put the "better fix", would it be in the while statement? should it be child of the statement? I tried the "simple fix" and it isn't working either. It returned a list of 33 items in one of the sections, that would work out to 8.25. Obviously it is

Re: preselecting radio buttons

2008-07-16 Thread webjunkie
Use the initial value: http://www.djangoproject.com/documentation/newforms/#initial On 16 Jul., 16:55, Bobby Roberts <[EMAIL PROTECTED]> wrote: > I've got a radio button group with 4 options and I was wondering if > there is a way in Django to preselect one of the options.

Re: Take an integer and string and make one string

2008-07-16 Thread Colin Bean
Format strings are your friend: "%s: %d" % (self.consequence, self.slope_height_rr) Colin On Wed, Jul 16, 2008 at 8:14 AM, Molly <[EMAIL PROTECTED]> wrote: > > I am trying to add an integer and a string: > > > def

Re: Take an integer and string and make one string

2008-07-16 Thread Chris Webber
String substitution is a bit easier for stuff like this. Try: def __unicode__(self): return u"%s: %s" % (self.consequence, self.slope_height_rr) On Wed, Jul 16, 2008 at 10:14 AM, Molly <[EMAIL PROTECTED]> wrote: > > I am trying to add an integer and a string: > >

Re: Take an integer and string and make one string

2008-07-16 Thread Brett Hoerner
On Wed, Jul 16, 2008 at 10:14 AM, Molly <[EMAIL PROTECTED]> wrote: > I am trying to add an integer and a string: I assume self.slope_height_rr is the float? Have you tried turning it into a string before adding it to another string? def __unicode__(self): return self.consequence + ':

Take an integer and string and make one string

2008-07-16 Thread Molly
I am trying to add an integer and a string: def __unicode__(self): return self.consequence + ': ' + self.slope_height_rr When I run my app, I get

preselecting radio buttons

2008-07-16 Thread Bobby Roberts
I've got a radio button group with 4 options and I was wondering if there is a way in Django to preselect one of the options. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Modulo of 4 not working right

2008-07-16 Thread Joshua Jonah
I'm not sure how to put the "better fix", would it be in the while statement? should it be child of the statement? I tried the "simple fix" and it isn't working either. It returned a list of 33 items in one of the sections, that would work out to 8.25. Obviously it is divisible, but i dont

Re: Change form - populating selected item from a ForeignKey field?

2008-07-16 Thread mbdtsmh
Thanks Rajesh - this works perfectly! I now have another question... What do I now do about manytomany fields for example look at the contributor field in the example below - I want the current contributors to be selected in the change form (these can obviously be more than one) models.py:

Turning on mod_python in Apache does not allow non-Django pages to rendor correctly

2008-07-16 Thread danielk
I've been doing things with PHP (and phpDocumentor) and recently started looking into Django. I now have the following in my 'httpd.conf' file: LoadModule python_module "C:/Progra~1/Apache~1/Apache2.2/modules/ mod_python.so" SetHandler python-program PythonHandler

Problem with custom manager from blog example in "Practical Django Projects"

2008-07-16 Thread Johan Liseborn
I am working through some of the examples from James Bennetts "Practical Django Projects" and I have encountered a small problem. Note that I am not describing the whole context here, so if you have not read the book, you may find it somewhat difficult to answer. In the blog example, we define

Re: Modulo of 4 not working right

2008-07-16 Thread Scott Moonen
Joshua, For the simple fix, I think you should remove the word "not" from your while condition. The better fix is to do the math all in one step: amountofblanks += (4 - (len(templist) + amountofblanks) % 4) % 4 -- Scott On Wed, Jul 16, 2008 at 10:30 AM, joshuajonah <[EMAIL PROTECTED]>

Re: Help with Forms (Dynamic Fields) - SOLVED

2008-07-16 Thread Srik
Solved On Jul 16, 3:39 pm, Srik <[EMAIL PROTECTED]> wrote: > Thanks Jeff. > > I also realized there is a provision to pass nested tuple like choices > to form while initalizing using field_list (Not documented but found > in django testing documents) > >

Re: Help with Forms (Dynamic Fields) - SOLVED (Request to update documentation if possible)

2008-07-16 Thread Srik
Thanks Jeff. I also realized there is a provision to pass nested tuple like choices to form while initalizing using field_list (Not documented but found in django testing documents) http://code.djangoproject.com/browser/django/trunk/tests/regressiontests/forms/forms.py (lines 715 - 797 )

Re: multiple one-to-one relationships

2008-07-16 Thread Eric Abrahamsen
> Saving how, exactly? If admin, newforms-admin or old admin? If old > admin, have you tried it on newforms-admin -- bugs in old admin are > unlikely to get any attention at this point. If saving in your own > code, more details of that code would help. > This is saving through the old

Modulo of 4 not working right

2008-07-16 Thread joshuajonah
I have a form model that is generating a dynamic number of fields. It is using a modulo conditional to see if the amount of fields if divisible by 4 (4 column layout). If it doesn't divide, it adds another field and then tries again. This is not working, it is returning field lists that are 30

accessing site settings in templates

2008-07-16 Thread Jon Brisbin
I can't find a good answer to this in the Django docs: is there a good way to access site-specific settings from your templates without having to put them in context variables? I've got my media served by Apache and everything else by Django. In my templates, I've got an ugly hack to

How do I know, in a unit test, the user authenticated after login?

2008-07-16 Thread Florencio Cano
Hi, I would like to know how I can retrieve the user id of the user authenticated in the auth subsystem after login in a test. class CrearCarteraTestCase(TestCase): fixtures = ['/fixtures/initial_data.xml'] def setUp(self): self.client = Client()

Re: Site wide date format

2008-07-16 Thread web-junkie
Wouldn't it be useful to use that setting as a default for the date filter, so you wouldn't need to specify a format every time? I could write a patch.. On 15 Jul., 15:31, Arien <[EMAIL PROTECTED]> wrote: > On Tue, Jul 15, 2008 at 8:14 AM, Adam Peacock <[EMAIL PROTECTED]> wrote: > > > I'm

Re: multiple one-to-one relationships

2008-07-16 Thread Karen Tracey
On Wed, Jul 16, 2008 at 2:49 AM, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: > I've got an issue with multiple one-to-one relationships, which > probably arises from poor design decisions on my part. Given a model > like the following: > > class Translator(models.Model): > user =

Re: capture http code 413 (file size too large)

2008-07-16 Thread [EMAIL PROTECTED]
hi Eric, thanks for the response. But I was looking from the point of adding the handler to apache. that way, if an uploaded file is larger than allowed size, it wont even get posted to the tmp directory and you wont end up using any bandwidth / memory with the illegal upload. its working

Re: Quick question about switching to newforms-admin branch....

2008-07-16 Thread Dan
I'm starting the project in two weeks, hopefully, it will be merge then. I cross my fingers. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Unique Case Sensitivity

2008-07-16 Thread Jeff FW
Check out: http://dev.mysql.com/doc/refman/5.0/en/case-sensitivity.html However, instead of dealing with it that way, you could also use this: http://www.djangoproject.com/documentation/db-api/#iexact -Jeff On Jul 16, 5:54 am, "Peter Melvyn" <[EMAIL PROTECTED]> wrote: > On Wed, Jul 16, 2008 at

Re: Quick question about switching to newforms-admin branch....

2008-07-16 Thread Jeff FW
According to: http://code.djangoproject.com/wiki/VersionOneRoadmap#must-have-features newforms-admin is a high priority. If you haven't already, take a look at: http://code.djangoproject.com/wiki/NewformsAdminBranch http://code.djangoproject.com/wiki/NewformsHOWTO They're both *really* helpful,

Re: Help with Forms (Dynamic Fields)

2008-07-16 Thread Jeff FW
In __init__, where you call form.Form's __init__, you need to pass data, *not* None. Also, you shouldn't try to duplicate all of the arguments. This should work better: def __init__(self, cat_slug, data=None, *args, **kwargs): forms.Form.__init__(self, data=data, *args, **kwargs) Also,

Re: django as a windows application

2008-07-16 Thread Molly
Saptah, Yes it is possible. I just did it. It is a long process and very frustrating. I would look here: http://www.jjude.com/index.php/archives/70 He does a good job of explaining what to do. If you have any questions I will help you out if I know the answer. Good luck! Molly On Jul 16,

How to deal with two distinct UserProfile model ?

2008-07-16 Thread Hades_L
Hello, I'm having trouble dealing with User module. In my application, I have two types of users who should be able to log in. The first one is an Employee, so I have a code like this: class Employee(models.Model): someFields = ... ... user = models.ForeignKey(User) and the other model

django as a windows application

2008-07-16 Thread saptah
Hello, I'd like to distribute an application for windows users, and I'd like to know if it's possible to "package" django and my APP in one .exe or in some package for distribution. The idea is to put it all in one autoexecutable package. Thanks for all :)

Re: change a value of database

2008-07-16 Thread Alfredo Alessandrini
solved... from GAME.models import Game p = Game.objects.get(id=1) p.name = '2' p.save() --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Question about a custom inclusion tag

2008-07-16 Thread Alaa Salman
On Jul 15, 9:10 pm, "Matic Žgur" <[EMAIL PROTECTED]> wrote: > is there a way to pass an argument from urls.py to inclusion tag? > > For example, if I have a custom inclusion tag that prints some links > to some pages and I don't want it to print the link to the page I'm > currently visiting, how

change a value of database

2008-07-16 Thread Alfredo Alessandrini
I've a simple a question... How can I update a single value of database?? I've try this: from GAME.models import Game Game.objects.filter(id=1) p.name='2' but don't update...It's add a row. thanks in advance, Alfredo --~--~-~--~~~---~--~~ You received

Re: object is unindexable

2008-07-16 Thread Matthias Kestenholz
On Wed, 2008-07-16 at 02:59 -0700, laspal wrote: > Hi, > I am getting the error "object is unindexable" > > code : > company = Company.objects.get( id = companyid) > for ss in company.financials.all() : > ss[1].year > ss[1].revenue > > ss.year and ss.revenue gives me the correct

Re: Help with Forms (Dynamic Fields)

2008-07-16 Thread Srik
Hi Jeff, I did try to move __init__ but the problem still exists. I tried to keep title and email along with other fields so that they will be appear in same order in Form. class MyForm(forms.Form): def __init__(self, cat_slug, data=None, files=None, auto_id='id_%s', prefix=None,

object is unindexable

2008-07-16 Thread laspal
Hi, I am getting the error "object is unindexable" code : company = Company.objects.get( id = companyid) for ss in company.financials.all() : ss[1].year ss[1].revenue ss.year and ss.revenue gives me the correct values for the entire list but I am want to get only the first one.?

Re: Unique Case Sensitivity

2008-07-16 Thread Peter Melvyn
On Wed, Jul 16, 2008 at 3:06 AM, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > I strongly suspect that the problem here is MySQL - in particular, the > collation on your text field. There are certain default setups for > MySQL which will result in all text fields being case insensitive. >

Re: file upload

2008-07-16 Thread Julien Phalip
Hi, Django's upload handling has recently been refurbished and it is now possible upload large files without upsetting the server. Check the doc for more info at: http://www.djangoproject.com/documentation/upload_handling/ Cheers, Julien On Jul 16, 7:49 pm, Niall Mccormack <[EMAIL

file upload

2008-07-16 Thread Niall Mccormack
Hi there, I've been reading about django file uploads on various blogs. Are there still issues with uploading large files? I may be creating a site for a production company and will need to ability to upload 5-20mb video files through the cms. Is this just a silly idea? If so, are there

Django windows apache service

2008-07-16 Thread [EMAIL PROTECTED]
Hi guys I have this configuration: Apache 2.2.6 mod_python 3.3.1 python 2.5.1 django 0.97-pre-SVN-7543 In httpd.conf there is configuration of my dj project: SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE dj_01.settings

RE: NEED HELP (I HAVE SOLVED ALREADY)

2008-07-16 Thread Kadusale, Myles
I just removed the underscore in max_length And it worked fine maybe because of my Django version Thanks anyway -Original Message- From: django-users@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Kadusale, Myles Sent: Wednesday, July 16, 2008 3:27 PM To:

Re: Filtering by returned name?

2008-07-16 Thread Matthias Kestenholz
On Wed, 2008-07-16 at 00:32 -0700, gnijholt wrote: > Hello Django-users, > > Say I have a model that returns its name like this: > > def __unicode__(self): > return str(self.distance_min) + "-" + str(self.distance_max) > > I want to filter this model based on those two values: >

Re: How to access the label of a model instance

2008-07-16 Thread Torsten Bronger
Hallöchen! Arien writes: > On Tue, Jul 15, 2008 at 2:08 PM, Arien <[EMAIL PROTECTED]> wrote: > >> Oh, I see, you want the verbose_name of each field. I suppose >> you could write a templatetag that you could use like this: >> >> {% verbose_name layer.heating_temperature %} >> {{

Filtering by returned name?

2008-07-16 Thread gnijholt
Hello Django-users, Say I have a model that returns its name like this: def __unicode__(self): return str(self.distance_min) + "-" + str(self.distance_max) I want to filter this model based on those two values: Distance.objects.filter("241-250") this obviously does not work, but is it

RE: NEED HELP (Revised)

2008-07-16 Thread Kadusale, Myles
Help! The indentions of my code in my editor are ok I hope the code will not be distorted here again I am trying out Django but I get this error in my console C:\DjangoProj\UserApp>python manage.py syncdb Error: Couldn't install apps, because there were errors in one or more models:

NEED HELP (Revised)

2008-07-16 Thread Kadusale, Myles
Help! The indentions of my code in my editor are ok I hope the code will not be distorted here again I am trying out Django but I get this error in my console C:\DjangoProj\UserApp>python manage.py syncdb Error: Couldn't install apps, because there were errors in one or more models:

Re: NEED HELP

2008-07-16 Thread Oscar Carlsson
Please post the code at dpaste.com, and paste the URL in the mail :-) As Kenneth suggested, I think it looks like an indentation error, but it's hard to detect or confirm while the mail is displayed with a non-monospaced font. Oscar On Wed, Jul 16, 2008 at 7:39 AM, Kadusale, Myles <[EMAIL

Re: NEED HELP

2008-07-16 Thread Kenneth Gonsalves
On 16-Jul-08, at 11:09 AM, Kadusale, Myles wrote: > 12.user_fname = models.CharField('First Name', max_length=30) >user_lname = models.CharField('Last Name', max_length=50) >user_email = models.EmailField('Email Address', blank=True) >user_gndr =

multiple one-to-one relationships

2008-07-16 Thread Eric Abrahamsen
I've got an issue with multiple one-to-one relationships, which probably arises from poor design decisions on my part. Given a model like the following: class Translator(models.Model): user = models.OneToOneField(User, unique=True, blank=True, null=True, help_text="If this translator

Re: capture http code 413 (file size too large)

2008-07-16 Thread Eric Abrahamsen
If you wanted to do this purely within django, you could write a custom middleware that reads a 'request body max size' setting from settings.py, then checks the content-length header on incoming request against that setting and returns a custom 413 if it's too large. I believe that doing

Re: writing unit tests for views?

2008-07-16 Thread pgb
On 15 Lip, 20:54, bshaurette <[EMAIL PROTECTED]> wrote: > For what it's worth, I finally came up with a simple working test forviews.   > Mytestswere written correctly all along, I just had to take > care of those errors related to the project settings.  It never > occurred me to just set