Re: ANN: django-morsels

2008-08-22 Thread Itai Tavor
Apologies to everyone who got bit by this. I updated the INSTALL instructions with the requirement of adding 'request' to the context. Itai On 23/08/2008, at 6:26 AM, lingrlongr wrote: > > Recommended fix @ http://code.google.com/p/django-morsels/issues/detail?id=1 > > On Aug 22, 2:51 pm, li

Re: Combining feeds

2008-08-22 Thread Eric Abrahamsen
Hey Eric, I've done this with two different models, the main trick was in the Feed class's items() method. What I'm doing is a little ugly: calling list() on the two querysets, appending one list to the other, then sorting the result using a function that determines which date attribute t

Hi

2008-08-22 Thread manitta
Hi , I have a question for u guys. I installed the django n everything looks like working fine. But when i try giving a request it does takes a screen shot. unfortunately am not able to see the screenshot..:( the screenshot is getting uploaded.. all data is visible but jus the blank page.. why is

Re: Boosting your productivity when debugging Django apps

2008-08-22 Thread John M
I tried eclipse with pyDev installed and it allows a pretty neat Visual Studio et al look and feel to it. John On Aug 22, 11:20 am, Delta20 <[EMAIL PROTECTED]> wrote: > This question is aimed at those of you who, like me, come from a Java > and C++ background and are used to being able to debug

Re: Composite Forms? Are widgets the right thing to use?

2008-08-22 Thread Jeff Anderson
Jon Loyens wrote: Hi all, I have a sight where I need to generate forms that are made up of two or three other forms. For example I have New User sign up form that accepts user information (user name, name, password), a shipping and a billing address (with the same usual field) and credit card

I wanna a complete sellout of one of my websites

2008-08-22 Thread mamcxyz
I'm refocusing my small ISV and wanna get rid of a portal website. I wanna give the domain, sourcecode, desing with sources, etc. Full ownership. Is using django pre-1.0. You can see it a http://www.paradondevamos.com. I have modules for blog, friends, searching with pylucene, photos, events & us

pagination best practices

2008-08-22 Thread Juan Hernandez
I have this very simple and primitive pagination method being called with this instruction in urls.py ### (r'^pyisp/menu/(\d+)/$', 'mail.views.menuPaginator'), ### This is the method ### def menuPaginator(request, number): domains = g.objects.all() paginator = ObjectPaginator(domains, 1

ldap authentication hangs under fcgi

2008-08-22 Thread mattxbart
Has anyone used python-ldap under fastcgi? Through the python interpreter I get expected results (con.simple_bind returns authenticated status code or throws exception) but when executed through the admin web form I get gateway timeouts under eginx and 500's under lighttpd, both using fastcgi meth

Re: How to set queryset on the second step of a form wizard?

2008-08-22 Thread rr
http://dpaste.com/73317/ I have dpasted it on the link above Cheers Roy On Aug 21, 2:30 pm, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > On Aug 21, 11:56 am, rr <[EMAIL PROTECTED]> wrote: > > > The url is herehttp://dpaste.com/72961/ > > I don't see anything glaringly wrong. You mentioned that it

Re: encrypted connection to remote database.

2008-08-22 Thread todbramble
> You will need to set the DATABASE_OPTIONS setting with a dictionary. > See these two docs: > > http://www.djangoproject.com/documentation/settings/#database-options > > http://mysql-python.sourceforge.net/MySQLdb.html#functions-and-attrib... > > -RD Thank you. That worked perfectly. For anyone

Composite Forms? Are widgets the right thing to use?

2008-08-22 Thread Jon Loyens
Hi all, I have a sight where I need to generate forms that are made up of two or three other forms. For example I have New User sign up form that accepts user information (user name, name, password), a shipping and a billing address (with the same usual field) and credit card info. Sometimes, I

Re: How to filter FOO_set in templates?

2008-08-22 Thread Garrett Garcia
On Fri, Aug 22, 2008 at 3:24 AM, Benjamin Buch <[EMAIL PROTECTED]> wrote: > > > > > I'm not sure i understand you question. You can filter via the > > attributes of a related object like this: > > Recording.objects.filter(song__artist="Ben Folds") > > Yes, and that's perfectly all right when you

unregister in old versions of django

2008-08-22 Thread aleray
Hi, I'm working with django revision 7513 and satchmo 0.7 because I heard they were doing nice job together. Howerver I would like to unregister some models in the admin interface, but I can't (and don't want to) touch to satchmo code. In satchmo 0.7.0, the models are registered with the admin cl

Re: 500.shtml

2008-08-22 Thread James Matthews
When i run on a shared provider i restart my server by running touch /mywebdir/dispatch.fcgi On Fri, Aug 22, 2008 at 6:45 AM, Emily Rodgers <[EMAIL PROTECTED]>wrote: > > Hi Ronaldo, > > It is not a python script, just a shell script that either runs 'python > manage.py runfcgi' with various opti

Django project idea (postfix+proftpd integration)

2008-08-22 Thread mark
Greetings from a new django user. Now that I'm done with the configuration of my server, it's time to setup a admin webpage so that certain local and 'virtual' (mysql) users can configure postfix and proftp databases. Both daemons, as well as courier-imap could be used together with a table struc

Re: FormWizard Problems

2008-08-22 Thread lingrlongr
So by using a combination of fields and exclude in the Meta class, I can choose what fields I want for that form. Nice! :) Two questions though: 1. Will fields be presented in the order specified in the fields tuple? 2. In my original model/form diagram, will there be a way for me to use th

Re: encrypted connection to remote database.

2008-08-22 Thread Rajesh Dhawan
> I just can't find how to do this. > > I set up a mysql user on the remote mysql host this way: > > GRANT ALL on somedatabase.* TO 'ssluser'@'remote_ip_address' > IDENTIFIED BY 'some_password' REQUIRE SSL; > > from the local mysql client I connect like this: > > mysql -u ssluser -p -h remote_ip_a

Re: ANN: django-morsels

2008-08-22 Thread lingrlongr
Recommended fix @ http://code.google.com/p/django-morsels/issues/detail?id=1 On Aug 22, 2:51 pm, lingrlongr <[EMAIL PROTECTED]> wrote: > If I change my view to this, it works: > > # views.py > def myview(request): >     return object_list( >         request, >         queryset=Stuff.objects.all()

Re: FormWizard Problems

2008-08-22 Thread lingrlongr
Ah, so I guess ModelForm will work with the FormWizard? I'll have to look through that documentation. Reading documentation is easier than pulling my hair out! =) Thanks Rajesh. On Aug 22, 4:14 pm, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > Hi Keith, > > > > > I'm using the form wizard for a

Re: FormWizard Problems

2008-08-22 Thread Rajesh Dhawan
Hi Keith, > I'm using the form wizard for a project. All the field names in > models.py coincide with the field names in forms.py. There is ONE > field that is consistently, yet sporadically, causing problems and I > cannot see why. > > # models.py > class PurchaseApplication(BasicApplication):

Re: noob: Where does print output go?

2008-08-22 Thread Gerard Petersen
Frantisek, It was, I just couldn't get it there because the print statement was in a view that was never invoked .. :-/ Thanx a lot. Regards, Gerard. Frantisek Malina wrote: > When using the development server, > print output is right in the terminal. > > --~--~-~--~~--

Re: Boosting your productivity when debugging Django apps

2008-08-22 Thread Rajesh Dhawan
Hi, > I'm new to both Python and Django, and right now I feel horribly > unproductive without an efficient way to debug things. Try http://winpdb.org/ -- although it's called WinPDB, it's a platform independent Python GUI debugger. -Rajesh D --~--~-~--~~~---~--~---

Re: Boosting your productivity when debugging Django apps

2008-08-22 Thread Dan
On Fri, Aug 22, 2008 at 2:20 PM, Delta20 <[EMAIL PROTECTED]>wrote: > > This question is aimed at those of you who, like me, come from a Java > and C++ background and are used to being able to debug things with a > debugger - setting breakpoints, stepping through code, evaluating > expressions, etc

Re: Boosting your productivity when debugging Django apps

2008-08-22 Thread Tim Chase
> This question is aimed at those of you who, like me, come from a Java > and C++ background and are used to being able to debug things with a > debugger - setting breakpoints, stepping through code, evaluating > expressions, etc. What do you find to be the most productive approach > to debugging

encrypted connection to remote database.

2008-08-22 Thread [EMAIL PROTECTED]
I just can't find how to do this. I set up a mysql user on the remote mysql host this way: GRANT ALL on somedatabase.* TO 'ssluser'@'remote_ip_address' IDENTIFIED BY 'some_password' REQUIRE SSL; from the local mysql client I connect like this: mysql -u ssluser -p -h remote_ip_address --ssl-ca=

Re: Admin mass change screen

2008-08-22 Thread John Shimek
On Mon, Aug 18, 2008 at 1:57 AM, Donn <[EMAIL PROTECTED]> wrote: > > On Sunday, 17 August 2008 20:38:06 varikin wrote: > > I am planning on using jquery sort to reorder them > > by dragging them on the change list. > Cool, if you get that right, I'd like to hear about it! > > \d > I got a chance

Re: ANN: django-morsels

2008-08-22 Thread lingrlongr
If I change my view to this, it works: # views.py def myview(request): return object_list( request, queryset=Stuff.objects.all(), extra_context = { 'request': request, } ) Is this supposed to be the right way to use morsels? Keith On Aug 22, 1

Re: lighttpd + fcgi + FORCE_SCRIPT_NAME = admin grief

2008-08-22 Thread James Matthews
Nick, The issue is with the url rewrite. while django puts in the script name lighttpd cannot read it because it's rewirting the url. E.g my FCGI script is mysite.fcgi and when i tried going to the django admin interface i would get a link like http://mysite.com/mysite.fcgi/adminhowever lighttpd

FormWizard Problems

2008-08-22 Thread lingrlongr
I'm using the form wizard for a project. All the field names in models.py coincide with the field names in forms.py. There is ONE field that is consistently, yet sporadically, causing problems and I cannot see why. # models.py class PurchaseApplication(BasicApplication): down_payment_assets

Re: Pre-populating an integer field with a count of model objects

2008-08-22 Thread varikin
On Aug 21, 11:29 am, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Aug 21, 4:42 pm, Brandon Taylor <[EMAIL PROTECTED]> wrote: > > > Hi everyone, > > > I have a column, 'position', which is a PositiveIntegerField, to allow > > my end-user to order records with. I would like to pre-populate the >

Boosting your productivity when debugging Django apps

2008-08-22 Thread Delta20
This question is aimed at those of you who, like me, come from a Java and C++ background and are used to being able to debug things with a debugger - setting breakpoints, stepping through code, evaluating expressions, etc. What do you find to be the most productive approach to debugging Django app

Re: Combining feeds

2008-08-22 Thread Eric Montgomery
Bumping this back up. Does anyone even know an easy way to create a feed which has items of different models (e.g. blog entries and podcast episodes in the same feed)? I'm not sure how to even do it by hand, much less by combining existing feeds. Thanks On Aug 20, 11:05 am, Eric Montgomery <[E

Getting my widgets to stop escaping

2008-08-22 Thread Alex G
Hi All, I am trying to make a custom django widget that contains a javascript call that uses unsafe characters (it passes a string to another function, so I need single quote characters); namely: class MyTextInput(forms.TextInput): def __init__(self, *args, **kwargs): att

Re: Using CheckboxSelectMultiple with a many to many relationship.

2008-08-22 Thread acreek
Hey thanks for that tip julianb. So I got used that to get the CheckboxSelectMultiple field to populate. However, instead of pulling only the coupons related to a specific flyer_id it seems to be pulling all of the coupons. Any thoughts? On Aug 22, 11:17 am, julianb <[EMAIL PROTECTED]> wrote: >

Re: Inline models in the admin interface not re-savable

2008-08-22 Thread Brian Rosner
On Fri, Aug 22, 2008 at 9:51 AM, markmuetz <[EMAIL PROTECTED]> wrote: > > Hi, > > I've got models defined so as I can edit one instance of model Option > as well as 3 other instances of OptionTranslation in the same Admin > page using the admin.TabularInline class. I can save the Option model > wi

Re: ANN: django-morsels

2008-08-22 Thread lingrlongr
I can't get this to work at all. Seems to bomb here: class MorselManager(models.Manager): def get_for_current(self, context, name, inherit=False): if not context.has_key('request'): <-- key never seems to exist return None I have a morsel defined with a URL of "

Re: ImageField validation

2008-08-22 Thread Michael Sanders
On Aug 22, 3:38 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > You should really be using forms here, even though you're not > submitting them through the normal channels. This would allow you to > use form-level validations, which are designed precisely for these > types of situations. Just crea

Inline models in the admin interface not re-savable

2008-08-22 Thread markmuetz
Hi, I've got models defined so as I can edit one instance of model Option as well as 3 other instances of OptionTranslation in the same Admin page using the admin.TabularInline class. I can save the Option model with a couple of OptionTranslation model the first time round, but aif I try and edit

Re: TextMate Django autocomplete

2008-08-22 Thread Dan Lazewatsky
There's a django bundle for textmate (http://macromates.com/svn/Bundles/trunk/Bundles/Python%20Django.tmbundle/). I don't use textmate's autocomplete stuff very much, but there's some in there. eka wrote: > Hi all, > How can I make my TextMate to autocomplete django? > I have django on my site

Re: Text Parsing Question

2008-08-22 Thread Robocop
Thanks for the suggestions guys, they all have been helpful. I will try and implement the customized filter idea right now, i had a feeling that i would be doing something like that if django lacked the built in functionality, though it doesn't seem bad at all. --~--~-~--~~---

Re: Announcing pytagram

2008-08-22 Thread Giuliani Vito Ivan
On Aug 22, 11:10 am, "Jorge Vargas" <[EMAIL PROTECTED]> wrote: > That seems nice, but have you check out sphinx's module > index?http://sphinx.pocoo.org/modindex.html > it's really a web thing but it can be printed. Yes I did, but I decided to go for my own solution because of: 1) I haven't been

Re: Text Parsing Question

2008-08-22 Thread Robocop
This looks like exactly what i was looking for. I will try and implement this idea right now, Thanks a ton Tim! On Aug 21, 6:15 pm, Tim Chase <[EMAIL PROTECTED]> wrote: > > So i'm working on a view that will need to parse character > > strings that will have a predictable structure, but dynamic

Re: database relationships

2008-08-22 Thread nek4life
Awesome. I got it to work using this code in my view. def artist_detail(request, slug): album_list = Album.objects.all() return list_detail.object_detail( request, queryset = Artist.objects.all(), slug = slug, template_object_name = 'artist', extra

TextMate Django autocomplete

2008-08-22 Thread eka
Hi all, How can I make my TextMate to autocomplete django? I have django on my site-packages. Eclipse with pydev has a pythonpath for each project, can't find something like that for TextMate. Regards --~--~-~--~~~---~--~~ You received this message because you are

Re: database relationships

2008-08-22 Thread lingrlongr
Also note, if your intentions were to grab all that information and just send the artist to the template, I think you'd get better performance if your queryset in the view looked like this: queryset=Artist.objects.select_related().all() Keith On Aug 22, 11:17 am, lingrlongr <[EMAIL PROTECTED]>

Re: database relationships

2008-08-22 Thread lingrlongr
Super easy :) Just to show you another way to implement generic views, I used custom view that returns a generic view. # urls.py from myapp.views import artist ... (r'^artist/(?P\w+)/$', artist), ... #views.py from django.views.generic.list_detail import object_detail def artist(request, slug):

Re: Using CheckboxSelectMultiple with a many to many relationship.

2008-08-22 Thread julianb
On Aug 22, 4:32 pm, acreek <[EMAIL PROTECTED]> wrote: > I just have not figured out the correct way to pass along the coupons > that are a part of the Flyer model. Can anyone give me a hint on how > to go about this properly? Here's how I'd do it: http://dpaste.com/hold/73229/ Now you just have

Re: newbie urls.py question

2008-08-22 Thread ViX
Just as Jason said, basically what we need to do is put the current site path in the system path. The Pinax approach is using python site package in the manage.py and put the current site path with site.addsitedir. There is another community application Sphene Community Tool which just simply us

Re: noob: Where does print output go?

2008-08-22 Thread lingrlongr
Take a look at django-logging. http://code.google.com/p/django-logging/wiki/Overview On Aug 22, 4:26 am, [EMAIL PROTECTED] wrote: > Hi All, > > Can anybody tell me if there's a possibility to see output of the > regular print command when used in a view? fo instance to a log file > with a "tail

Re: Set invalid error on exception SMTPSenderRefused

2008-08-22 Thread Karen Tracey
On Fri, Aug 22, 2008 at 7:13 AM, janedenone <[EMAIL PROTECTED]>wrote: > > Hi, > > I validate my contact form through Django's form validation framework. > The SMTPSenderRefused exception, however, is not caught in the > validation process. Now I would like to > >try: >send_

Re: Save raw data to an ImageField?

2008-08-22 Thread julianb
On Aug 22, 2:54 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > If, however, you mean that the file is already a StringIO, rather than > a file, and you'd like to save it to a file, I hope to have a fix up > for that this weekend. It's possible right now, but it's not very > easy, much less pretty

Re: ImageField validation

2008-08-22 Thread Marty Alchin
On Fri, Aug 22, 2008 at 10:22 AM, Michael Sanders <[EMAIL PROTECTED]> wrote: > Is this a consequence of http://code.djangoproject.com/changeset/8348 > or should I be doing something else to enable this validation? (I have > PIL installed). Would it be preferable to use a Django form for the > imag

Re: import of mysql in settings.py

2008-08-22 Thread Karen Tracey
On Thu, Aug 21, 2008 at 10:23 PM, Ian Holsman <[EMAIL PROTECTED]> wrote: > > Cortland Klein wrote: > > I just had the same problem. It has something to do with MySQLdb not > > being included. > > > > > > when it rain's it pours. I'm been hitting my head on the same problem. > to verify that this i

Using CheckboxSelectMultiple with a many to many relationship.

2008-08-22 Thread acreek
Hi, I am making a form that allows for the user filling it out to select multiple coupons from a list of 20. This form will simply send an email to me with the selected coupons. So my model looks like this: class Flyer(models.Model): coupons = models.ManyToManyField(Coupon) I have my form s

ImageField validation

2008-08-22 Thread Michael Sanders
Using Django svn r8463 I have the following model: class Image(models.Model): description = models.CharField(max_length=100) image = models.ImageField(upload_to='images') ...and view: def upload_image(request): upFile = request.FILES['file'] newImage = Image() newImage.ima

Re: noob: Where does print output go?

2008-08-22 Thread Frantisek Malina
When using the development server, print output is right in the terminal. --~--~-~--~~~---~--~~ 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 uns

Re: Problem with generic views in tutorial example

2008-08-22 Thread Karen Tracey
On Fri, Aug 22, 2008 at 4:38 AM, Rodney Topor <[EMAIL PROTECTED]> wrote: > > On Aug 22, 4:18 pm, Anurag Goel <[EMAIL PROTECTED]> wrote: > > I was able to implement the generic views change with yesterday's > > trunk version successfully. I did not have to do anything special (no > > separate admin

Re: database relationships

2008-08-22 Thread nek4life
So if I sent the artist to the template and wanted to grab the list of albums with all the album tracks how would I go about that. Would I have to pull in all the data with a custom view? So far I've only been using generic views. It definitely makes sense pulling in the information through the

Re: noob: Where does print output go?

2008-08-22 Thread Gerard
Emily, Great idea, thanx! Regards, Gerard. Emily Rodgers wrote: > You could use the python logging module > (http://docs.python.org/lib/module-logging.html) and do > logging.debug(list(product_list)). Then it will appear in your web logs. > >> -Original Message- >> From: django-users@

RE: 500.shtml

2008-08-22 Thread Emily Rodgers
Hi Ronaldo, It is not a python script, just a shell script that either runs 'python manage.py runfcgi' with various options (the errorlog being one), or kills the django process if needed (I guess like you are doing with "kill -HUP dispatch.pid"). I think you need to speak to the person who set

Re: Model method or manager?

2008-08-22 Thread Rajesh Dhawan
Benjamin Buch wrote: > Hi, > > I have a method in a class that filters related objects > (get_representative_recording): > > class Song(models.Model): > title = models.CharField(max_length=50) > description = models.TextField(blank=True) > > def get_r

Need a better way to send and retrieve data through third-party form

2008-08-22 Thread [EMAIL PROTECTED]
I have an online store that sends all the form fields off to the bank for payment processing, which then sends all the form data back to me and if it has a credit card authorization, I record the order. Currently, I'm passing the items in the cart over as strings: for item in cart.items():

Re: AND OR in ifequal

2008-08-22 Thread Rajesh Dhawan
On Aug 22, 8:00 am, Will Rocisky <[EMAIL PROTECTED]> wrote: > how do you put AND, OR in ifequal statement of django? Use nested if statements that use one operator at a time. There's an example towards the end of the IF tag documentation here: http://www.djangoproject.com/documentation/templates

Re: Save raw data to an ImageField?

2008-08-22 Thread Marty Alchin
On Fri, Aug 22, 2008 at 8:35 AM, julianb <[EMAIL PROTECTED]> wrote: > What if the file never has a path and exists just as StringIO? I can't > seem to get it to be a "Django file"... I'm a bit confused by that. Do you mean that you don't want to save it to a file, or that it's not a file already?

Re: 500.shtml

2008-08-22 Thread Ronaldo Zacarias Afonso
Hi Emily, Well, in fact I don't start/stop/restart my webserver. As I am using a shared host, the company where I host my website do those things for me. When I do some modification to my site I only have to issue a "kill -HUP dispatch.pid" command. Some thing that I notice is that when I try to

Re: Slash appended for URLs ending in .html?

2008-08-22 Thread julianb
On Aug 22, 12:55 pm, janedenone <[EMAIL PROTECTED]> wrote: > Which version of Django do you use? Using trunk, 8129 to be exactly. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Save raw data to an ImageField?

2008-08-22 Thread julianb
On Aug 14, 1:31 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > You'll want to skip StringIO now, because Django provides its own > file-like object you can use directly. When you want to save the file, > you can open up a new File and just use that instead. > > from django.core.files.storage impo

AND OR in ifequal

2008-08-22 Thread Will Rocisky
how do you put AND, OR in ifequal statement of django? --~--~-~--~~~---~--~~ 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

Set invalid error on exception SMTPSenderRefused

2008-08-22 Thread janedenone
Hi, I validate my contact form through Django's form validation framework. The SMTPSenderRefused exception, however, is not caught in the validation process. Now I would like to try: send_mail(form.cleaned_data['subject'], form.cleaned_data['message'], form.cleaned_data['

Model method or manager?

2008-08-22 Thread Benjamin Buch
Hi, I have a method in a class that filters related objects (get_representative_recording): class Song(models.Model): title = models.CharField(max_length=50) description = models.TextField(blank=True) def get_representative_recording(self):

Re: Custom error_class for formatting single errors?

2008-08-22 Thread janedenone
Sorry: Solved the issue by modifying my CSS for ul.errorlist. On 22 Aug., 11:57, janedenone <[EMAIL PROTECTED]> wrote: > Edit: > > I found the ErrorDict class in django/forms/util.py, but specifying a > custom error_dict parameter to a new form (error_dict=SpanErrorDict) > results in a TypeError

Re: Slash appended for URLs ending in .html?

2008-08-22 Thread janedenone
On 22 Aug., 12:12, julianb <[EMAIL PROTECTED]> wrote: > > It's not a bug. If you want URLs that end in .html you have to turn > > APPEND_SLASH off. > > This can't be true. I have APPEND_SLASH set to default (=True) and it > works with URLs ending in .htm, so there has to be something wrong > with

RE: noob: Where does print output go?

2008-08-22 Thread Emily Rodgers
You could use the python logging module (http://docs.python.org/lib/module-logging.html) and do logging.debug(list(product_list)). Then it will appear in your web logs. > -Original Message- > From: django-users@googlegroups.com > [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] >

noob: Where does print output go?

2008-08-22 Thread gjp
Hi All, Can anybody tell me if there's a possibility to see output of the regular print command when used in a view? fo instance to a log file with a "tail -f" The code: def detail(request, id): p = get_object_or_404(Customer, pk=customer_id) product_list = p.product_set.all() print

Re: How to filter FOO_set in templates?

2008-08-22 Thread Benjamin Buch
> I'm not sure i understand you question. You can filter via the > attributes of a related object like this: > Recording.objects.filter(song__artist="Ben Folds") Yes, and that's perfectly all right when you are only interested only in the related objects. But what do you do when you want t

Re: Field with RadioSelect widget instead of Select widget

2008-08-22 Thread julianb
On Aug 21, 7:30 pm, Bela Hausmann <[EMAIL PROTECTED]> wrote: > Hi! > > I'd like to use the RadioSelect widget for some of my model fields with > choices. But django always uses Select and if I change it manually in the form > class, than I have to specify the choices again and if it's optional or

Re: Slash appended for URLs ending in .html?

2008-08-22 Thread julianb
> It's not a bug. If you want URLs that end in .html you have to turn > APPEND_SLASH off. This can't be true. I have APPEND_SLASH set to default (=True) and it works with URLs ending in .htm, so there has to be something wrong with Jan's URL configuration. --~--~-~--~~~---

Re: Custom error_class for formatting single errors?

2008-08-22 Thread janedenone
Edit: I found the ErrorDict class in django/forms/util.py, but specifying a custom error_dict parameter to a new form (error_dict=SpanErrorDict) results in a TypeError (_init__() got an unexpected keyword argument 'error_dict'). How can I force my errors to use my custom SpanErrorDict when being

RE: 500.shtml

2008-08-22 Thread Emily Rodgers
How do you start / stop / restart your webserver? If you are using fastcgi, you may not have it set up to give you an error log. I have a script that starts / stops it, and I have specified and error log for the django web server logs, and sent any errors with my script commands to a file so that

Custom error_class for formatting single errors?

2008-08-22 Thread janedenone
Hi, I'd like to use a custom error_class for formatting errors like this: form = ContactForm(data, auto_id=False, error_class=SpanErrorList) This works fine as long as the template contains {{ form.as_p }} but if I want to use a more flexible output {% for field in form %} {{ field.labe

Re: ANN: django-morsels

2008-08-22 Thread Jorge Vargas
thanks seems interesting. On Thu, Aug 21, 2008 at 3:19 AM, Itai Tavor <[EMAIL PROTECTED]> wrote: > > At first glance (and, quite possibly, second and third) django-morsels > might look like a clone of django-chunks > (http://code.google.com/p/django-chunks/ > ). Both apps attempt to solve the sa

Re: Announcing pytagram

2008-08-22 Thread Jorge Vargas
That seems nice, but have you check out sphinx's module index? http://sphinx.pocoo.org/modindex.html it's really a web thing but it can be printed. On Thu, Aug 21, 2008 at 9:00 AM, Giuliani Vito Ivan <[EMAIL PROTECTED]> wrote: > > Hi, > I recently started a little project named pytagram (http://

Re: wsgi in django for hgwebproxy

2008-08-22 Thread Jorge Vargas
On Thu, Aug 21, 2008 at 12:54 PM, Faheem Mitha <[EMAIL PROTECTED]> wrote: > > Hello everyone, > > The version control system mercurial (hg) has some functionality to allow > its repositories to be viewed via the web. However, it does not have a > builtin authentication system. > There is another a

Re: Problem with generic views in tutorial example

2008-08-22 Thread Rodney Topor
On Aug 22, 4:18 pm, Anurag Goel <[EMAIL PROTECTED]> wrote: > I was able to implement the generic views change with yesterday's > trunk version successfully. I did not have to do anything special (no > separate admin.py, no get_absolute_url()) > > I did however, do something that the tutorial did n

Re: Slash appended for URLs ending in .html?

2008-08-22 Thread janedenone
Doh, I was reading this from the 0.96 docs: "Performs URL rewriting based on the APPEND_SLASH and PREPEND_WWW settings. If APPEND_SLASH is True, URLs that lack a trailing slash will be redirected to the same URL with a trailing slash, unless the last component in the path contains a period. So fo

Re: Slash appended for URLs ending in .html?

2008-08-22 Thread Matthias Kestenholz
Hi, On Fri, Aug 22, 2008 at 10:14 AM, janedenone <[EMAIL PROTECTED]> wrote: > > Hi there, > > I installed the current development version of Django about two weeks > ago. APPEND_SLASH is set to true, and it appends a slash to all URLs, > even the ones ending in .html. Is that a known bug? > It's

Re: polymorphism and abstract classes

2008-08-22 Thread Shay
Hi Kip, Thanks for your help with this. :) MTI is meant to be Multi-Table Inheritance, sorry. I copied the reference from other Django related docs. :) About using that generic_relations example, it's hard to explain without diagrams but I'll give it a try... Based on that example: Animals/V

Slash appended for URLs ending in .html?

2008-08-22 Thread janedenone
Hi there, I installed the current development version of Django about two weeks ago. APPEND_SLASH is set to true, and it appends a slash to all URLs, even the ones ending in .html. Is that a known bug? Kind regards, Jan --~--~-~--~~~---~--~~ You received this mess

Re: override model.save - prevent saving (admin)

2008-08-22 Thread David Zhou
On Aug 22, 2008, at 2:10 AM, jboutros wrote: > I have a model where I've overridden the save method. In a specific > case (validation fails against an external web service), I would like > to prevent the save from happening. I have implemented this by not > calling super.save in this case. > >