custom ordering on related objects

2007-12-10 Thread Sean Perry
Say we have: class Foo(models.Model): title = models.CharField(max_length=128) number = models.PositiveSmallIntegerField() bar = models.ForeignKey('Bar') class Meta: ordering = ['title',] class Bar(models.Model): title = models.CharField(max_length=128) c

Re: Django Application Without Source?

2007-12-10 Thread Kenneth Gonsalves
try java, or C or even BF On 11-Dec-07, at 10:32 AM, [EMAIL PROTECTED] wrote: > > Shoot, so maybe Python just isn't the language for this kind of > project. I'm not really concerned with making it bullet-proof to > decompilation, just not so glaringly obvious as opening up the source > files :)

Re: Django Application Without Source?

2007-12-10 Thread Derek Anderson
are you building this for a specific client? or looking to sell to many? if the former, i'd strongly suggest considering trusting your client with the code. you're likely to see that trust reflected back towards you in your relationship. lots of for-hire-and-support contract work goes belly

ANN: Agoranomos (7.12.11)

2007-12-10 Thread Max Battcher
I'm not sure how much interest there will be in this, but I was figuring that maybe someone might have a good use for this, and I don't know of any existing applications out there for this. I built a simple Django-based Auction application for a class final project. It's specifically intended fo

Re: Django Application Without Source?

2007-12-10 Thread [EMAIL PROTECTED]
Shoot, so maybe Python just isn't the language for this kind of project. I'm not really concerned with making it bullet-proof to decompilation, just not so glaringly obvious as opening up the source files :) On Dec 10, 3:29 pm, "Jay Parlar" <[EMAIL PROTECTED]> wrote: > On Dec 10, 2007 2:43 AM, [E

Re: cannot import ModelForm

2007-12-10 Thread Marty Alchin
On 12/10/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > from django.newforms.models import ModelForm > > That's not necessary. What the original poster is trying to do should > work (it certainly does for me). ModelForms is imported into the > django.newforms namespace. Ah, okay. I hadn't

Re: cannot import ModelForm

2007-12-10 Thread Kenneth Gonsalves
On 11-Dec-07, at 8:42 AM, Malcolm Tredinnick wrote: >> doesnt work. Is there a ModelForm - I see a ModelChoiceForm and a >> ModelMultipleChoiceForm > > Then your source code checkout of [6906], which the original poster > said > he was using, is corrupt. You should fix that problem before doin

Re: cannot import ModelForm

2007-12-10 Thread Kenneth Gonsalves
On 11-Dec-07, at 8:40 AM, Kenneth Gonsalves wrote: > On 11-Dec-07, at 8:34 AM, Marty Alchin wrote: > >>> Any ideas? >> >> from django.newforms.models import ModelForm > > doesnt work. Is there a ModelForm - I see a ModelChoiceForm and a > ModelMultipleChoiceForm arrrgghhh - not the latest svn h

Re: cannot import ModelForm

2007-12-10 Thread Malcolm Tredinnick
On Tue, 2007-12-11 at 08:40 +0530, Kenneth Gonsalves wrote: > > On 11-Dec-07, at 8:34 AM, Marty Alchin wrote: > > >> Any ideas? > > > > from django.newforms.models import ModelForm > > doesnt work. Is there a ModelForm - I see a ModelChoiceForm and a > ModelMultipleChoiceForm Then your sour

Re: cannot import ModelForm

2007-12-10 Thread Kenneth Gonsalves
On 11-Dec-07, at 8:34 AM, Marty Alchin wrote: >> Any ideas? > > from django.newforms.models import ModelForm doesnt work. Is there a ModelForm - I see a ModelChoiceForm and a ModelMultipleChoiceForm -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ Foss Conference

Re: cannot import ModelForm

2007-12-10 Thread Malcolm Tredinnick
On Mon, 2007-12-10 at 22:04 -0500, Marty Alchin wrote: > On 12/10/07, l5x <[EMAIL PROTECTED]> wrote: > > Any ideas? > > from django.newforms.models import ModelForm That's not necessary. What the original poster is trying to do should work (it certainly does for me). ModelForms is imported into

Re: cannot import ModelForm

2007-12-10 Thread Marty Alchin
On 12/10/07, l5x <[EMAIL PROTECTED]> wrote: > Any ideas? from django.newforms.models import ModelForm -Gul --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

cannot import ModelForm

2007-12-10 Thread l5x
Hello, I have been working Django (mod_python or Django server as well). I have updated it to SVN 6906 (newest at this time), because I wanted to use the ModelForm, but unfortunately: Python 2.5.1 (r251:54863, Oct 5 2007, 13:36:32) [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on l

Re: Django implementation of AssetPackager, anyone?

2007-12-10 Thread Alex Dong
What's tricky here is how to do all of these on the fly and update the output if there is any changes to the underlying javascript files. Any thoughts on how to do that? Or, maybe we should use a svn hook instead of django template tag for this task? Alex On Dec 11, 12:47 am, David Reynolds <[E

Re: Fwd: Break with Django SVN r6718

2007-12-10 Thread Josh Stone
On Dec 10, 2007 3:03 PM, Todd O'Bryan <[EMAIL PROTECTED]> wrote: > Hmm. What you said about not having Django installed in site-packages > makes me think... > > What does your PYTHONPATH environment variable have in it? > I wasn't setting PYTHONPATH to anything. Normally packages are picked up j

Re: Prevent SQL-injection

2007-12-10 Thread Malcolm Tredinnick
On Sun, 2007-12-09 at 14:15 -0800, Nianbig wrote: > Thanks for your reply. > > I´m building an advanced search/filter page and it got too messy doing > it with the standard Django ORM... so I decided to go with my own SQL- > string... > Therefore I need a function that can make input strings SQL

Re: Dealing with related objects in a generic way

2007-12-10 Thread Wyley
> You're not missing anything - traversing _meta.fields et al is pretty > much how you would need to do what you are describing. Thanks, that's what I needed to know! Richard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: parameters getting modified

2007-12-10 Thread l5x
If the example from Rajesh isn't working maybe you should do sth like that: /post// ? For example: /post/http/google.com Then join it 'http' + '://' + 'google.com' --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "

Re: Fwd: Break with Django SVN r6718

2007-12-10 Thread Todd O'Bryan
Hmm. What you said about not having Django installed in site-packages makes me think... What does your PYTHONPATH environment variable have in it? Do you possibly have the current directory listed before the path to Django? Because if you try to from django.conf import settings before your set

Re: Dealing with related objects in a generic way

2007-12-10 Thread Russell Keith-Magee
On Dec 11, 2007 7:09 AM, Wyley <[EMAIL PROTECTED]> wrote: > > Hello all, > > These seem like common tasks, but I haven't been able to find any > documentation that really gets into the nuts and bolts of dealing with > related objects, so I find myself doing things like iterating over > deserialize

Dealing with related objects in a generic way

2007-12-10 Thread Wyley
Hello all, I am new to Django and quite excited to be using it. I am attempting to write some generic import and export methods, and I keep running into a conceptual hurdle that has to do with related objects:how can I recursively follow database relations in a way that's not model- dependen

Re: Django Application Without Source?

2007-12-10 Thread Jay Parlar
On Dec 10, 2007 2:43 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Or perhaps I'm reading into this too much. If I distribute the .pyc > files minus the .py files, would that work? Is this machine- > independent (IE: I "compile" the source on an x86, it'll be ok on a 64- > bit or other arch

سلام

2007-12-10 Thread غاغا
سلام شباب انا من اليمن اتمنى ان اجد اصدقاء اتعرف عليهم [EMAIL PROTECTED] اذا ايميلي للتعارف --~--~-~--~~~---~--~~ 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@googl

اه يازمن

2007-12-10 Thread غاغا
سلام عليكم اتمنى ان اجد انثى بمعنى الانوثة تؤمن بان الحب في زمننا هذا قد مات وين انت ياحنون ودي ابرد نار قلبي ودي احتضنك بالعيون --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this g

Re: Fwd: Break with Django SVN r6718

2007-12-10 Thread Josh Stone
I'm not sure what else to try, but let me know if there's something specific you want to see. Here's a similar session to what you ran, but note that I demonstrate 6717 working first. Also note that I'm running Django from '~/mysite/django'; I don't have any Django version installed in site-packa

How to set ForeignKey with generic create view?

2007-12-10 Thread Florian Lindner
Hello, I have this model: class BlogComment(Model): blogEntry = ForeignKey(BlogEntry, edit_inline=STACKED, num_in_admin=1) author = CharField(max_length=100, core=True) authorMail = EmailField(blank=True) content = TextField(core=True) Now I want to use the generic.create_updat

Re: Noob question: Which Linux distribution is "best" for Django?

2007-12-10 Thread kevinski
A little over a year ago, I was in your shoes. Microsoft just didn't do it for me anymore, and I wasn't sure where to turn. A lot of people here are recommending Ubuntu, but as an individual that was not too long ago in your situation, and has quickly developed a decent knowledge of Linux server a

Re: creating user and profile in just one form

2007-12-10 Thread Joe
I've done this but with a manually built form. You can just add the extra form fields to the template, then reference those extra fields in your view. new_data['your_new_fieldname'] will work as expected. In your view you might first create the user object - then create the customer object rela

Re: parameters getting modified

2007-12-10 Thread Rajesh Dhawan
Hi Venkat, > i have the following pattern, '^post/(?P.*)', 'post' > and, my url is post/http://google.com > but, I get it as http:/google.com I don't think this is a Django bug. It's likely that your HTTP server (mod_python, FCGI layer, etc.) is "normalizing" those forward slashes well before th

Re: Django implementation of AssetPackager, anyone?

2007-12-10 Thread David Reynolds
On 10 Dec 2007, at 4:36 pm, David Reynolds wrote: > If there's a python library for compressing javascript files (which I > suspect there is) it shouldn't be too difficult to make your own > templatetag to do this. For example this... http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496

Variable block name

2007-12-10 Thread diegor
Hi everybody. Can i do the below thing? in the template "foo.html" write this: ... {% for n in objects %} var nomeform_{{n.i}} = "{%block validate_form_{{n.i}} %} {%endblock%}"; {% endfor %} ... In the template "foo2.html" write this: {% extends "foo.html"%} ... {%block validat

Re: Django implementation of AssetPackager, anyone?

2007-12-10 Thread David Reynolds
On 10 Dec 2007, at 3:55 pm, Alex Dong wrote: > > Hello everyone, > > I'm wondering are there anyone who is working on a django version of > the AssetPackager? I found it's a pretty cool performance booster with > little work required from the developer side. Definitely a tool for > perfectionist

Django implementation of AssetPackager, anyone?

2007-12-10 Thread Alex Dong
Hello everyone, I'm wondering are there anyone who is working on a django version of the AssetPackager? I found it's a pretty cool performance booster with little work required from the developer side. Definitely a tool for perfectionist. :-) Here is the url of the ruby version: http://synthes

Re: Wrong id returned from a record in mysql

2007-12-10 Thread Alex Koshelev
And where is problem? This is normal behaviour. On 10 дек, 17:24, DierRe <[EMAIL PROTECTED]> wrote: > Hello! I have a weird problem. > This is the model, really simple. > > class Tags(models.Model): > tag_id = models.AutoField(primary_key=True) > name = models.CharField(max_length

Wrong id returned from a record in mysql

2007-12-10 Thread DierRe
Hello! I have a weird problem. This is the model, really simple. class Tags(models.Model): tag_id = models.AutoField(primary_key=True) name = models.CharField(max_length=100) slug = models.SlugField(db_index=True,max_length=100,unique=True) amount = models.IntegerF

Re: ImageField and save method

2007-12-10 Thread Julien
Hey, thanks guys, now I understand a little better. One of the articles you're pointing says: "Currently, the only technique you can reliably use is to override _save_FIELD_file on your model. This isn't quite the same as save_FOO_file that's officially documented." I in fact followed the docume

Re: ImageField and save method

2007-12-10 Thread Marty Alchin
On Dec 10, 2007 7:46 AM, Julien <[EMAIL PROTECTED]> wrote: > In the following example, the "save_avatar_file" method is never > called. However the "_save_FIELD_file" method is called. > It looks a bit dirty to me, and I'd like to get rid of the > "_save_FIELD_file method", to only use a method fo

Re: ImageField and save method

2007-12-10 Thread Thomas
I think this provides more (partially) detail: http://gulopine.gamemusic.org/2007/11/customizing-filenames-without-patching.html Thomas On Dec 10, 2:01 pm, Julien <[EMAIL PROTECTED]> wrote: > I don't explicitly call it myself. > In fact, the _save_FIELD_file method (not save_avatar_file) is > au

Re: ImageField and save method

2007-12-10 Thread Julien
I don't explicitly call it myself. In fact, the _save_FIELD_file method (not save_avatar_file) is automatically called when I save a UserProfile object in the admin interface, or using a custom form generated by form_for_instance. Any idea? On Dec 10, 11:53 pm, Thomas <[EMAIL PROTECTED]> wrote:

Re: ImageField and save method

2007-12-10 Thread Thomas
I saw something similar with overridden save(). How/where do you call it? Thomas On Dec 10, 1:46 pm, Julien <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm struggling to understand why, when I upload an image field (either > from the admin interface or from a custom view), the overriden > save_FOO

ImageField and save method

2007-12-10 Thread Julien
Hi all, I'm struggling to understand why, when I upload an image field (either from the admin interface or from a custom view), the overriden save_FOO_file method is never called. In the following example, the "save_avatar_file" method is never called. However the "_save_FIELD_file" method is ca

creating user and profile in just one form

2007-12-10 Thread Simone Cittadini
I have this code to add a new user : class CustomerForm(ModelForm): class Meta: model = CustomerProfile def add(request): [..] if request.method == 'POST': form = CustomerForm(customer, request.POST) f.save() else: form = Cu