Nose about future
We are starting a new project soon (within a month, after closing a research phase). Django V1.0 means (as far as i can recall from wiki) "do not expect backward compatibility before 1.0". Obviously major design elements and data models are not affected later, but (watching django version number convergency to 1.0) i am wondering can you (anybody) estimate: 1. what are those areas of api or framework where we encounter major rewrites interfacing with it 2. arrival time of 1.0 I do not try to play a sure game (wish i can do), just estimating amount of troubles. Thanks, Charlie. -- "...s minden mestert kinevettem, ki nem nevetett önmagán." GPG public key: http://www.rendszergazda.com/gpg/charlie-gpg-public-key.asc --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Build your job
Dear friend I am glad for your email. From the thousands of e-mails I receive I chose yours too in order to create a group of one from each country. You will be the first from your country and you will have the chance to create successful carrier in your country. By joining this company, you have two advantages : You can make business and money internationally, working from home through internet, creating your own business. You can save money when purchasing in special prices , exclusively for our club members. To be a member all you have to do is to JOIN FOR FREE without any other obligation, by clicking the next http://www.clubshop.com/cgi/appx.cgi/3440162 After your enrol I will contact you in privacy and I will give the first instructions that you need If you decide to get involved with business seriously, except the benefits of a simple member, you will have more as a full and active member of the Club (VIP member ). For more information and of course to get special training for free it is necessary to be a member. I will be contact only with the first from each country who will become members. Thousands of applications are coming daily; as a result I can not accept more than one of each country. After that they will have the chance to develop. I encourage you to make your decision and join without any doubt for your ability to succeed, because it is team work and you will not be working alone ,but you will have me to help you as your sponsor, as I do with the rest of my team! It is amazing how this job can make you feel happy by combining fun and money!!! I'll be glad to answer any questions you may have, and of course to welcome you as a new member. http://www.clubshop.com/cgi/appx.cgi/3440162 Sincerely Yours ÅËÅÁÍÍÁ FILIPPOGLOY FOTIS GREGORIOU THE DHS CLUB VIP MEMBER CONTACT INFO ÅËÅÁÍÍÁ FILIPPOGLOY Email: [EMAIL PROTECTED] Note: ps. This is one time email. If you have received it by mistake, please forgive us and just ignore it. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: combining models in something like a queryset?
> One possible method is to create a VIEW in your db that does a UNION of > columns from different tables. I meant to say: ...does a UNION of rows from different tables, selecting columns or calculated columns that are equivalent. Luke --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Affiliate program
Dear friends I have sent a lot of emails to help you understand what DHS CLUB is. The DHS CLUB is a global multistore company where you can find everything you need, from a couple of shoes NIKE with only $25, parfums and fragrances as ESTEE LAUDER with only $25, up to many famous brands of cars, electronics, clothing, travels and vacation packages and hundreds other stores on a big variety of products that you need in daily life. You can also find great offers and discounts up to 50% and prices lower than your neighborhood stores. The best of all is that, THE DHS CLUB , gives you the right to make your own business with your unique ID number as a member so you can introduce it to your friends or any other customers and then you can earn commissions from their purchases. In addition, if you have an enterprise, you can put it into this club and get over 3.5 millions of customers, meaning the members of the club and so the club will advertise you for free to all of them. You can also introduce and have other enterprises signed up, under you, so you will get commission from their sales as well. So DON'T BE LATE…Sign up NOW !!! DECIDE FIRST AND BE THE FIRST IN BUSINESS. Sign up now http://www.clubshop.com/cgi/appx.cgi/3440162 After your sign up sent me a personal e-mail with subject (upgrate to VIP) my email: [EMAIL PROTECTED] http://www.clubshop.com/cgi/appx.cgi/3440162 BUILD YOUR OWN BUSINESS…BUILD YOUR FUTURE ! Sign up now http://www.clubshop.com/cgi/appx.cgi/3440162 After your sign up sent me a personal e-mail with subject (upgrate to VIP) my email: [EMAIL PROTECTED] http://www.clubshop.com/cgi/appx.cgi/3440162 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Serious Noobie question, what the $ for in urlpatterns.
On 6 Jun 2006, at 03:26, John M wrote: > how does that differ from > > (r'^polls/'), > (r'^polls/(\d+)/$') > > Note the $ is missing from the first line of the second example. > > When you don't have a $ in the polls/ setup, it doesn't scan down to > the other entries. > > Since I'm so new to python and web stuff, was wondering if anyone > could > explain this. Those strings are Python regular expressions. The dollar sign at the end means "match the end of the string". The regular expressions are tried against the URL that has been entered in order. '^polls/' without a $ will match any URL that starts with the string 'polls/', thus terminating the lookup at that point. If you include the dollar, strings that start with polls/ but continue after the / will no longer match that particular pattern. Hope that helps, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django Quick Start with Schema Evolution Support
Ilias Lazaridis wrote: > http://lazaridis.com/core/eval/index.html Your phone contact is not working. I get the impression you're only a scam. Michael --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Log file analyze
2006/6/6, Adrian Holovaty <[EMAIL PROTECTED]>: Are you using Apache? If so, this is something you configure inApache's httpd.conf configuration file, not in Django. See the ApacheLogFormat directive: http://httpd.apache.org/docs/2.2/mod/mod_log_config.html#logformatAdrianWhat about a statistics page in admin interface? Maybe in the contrib module?Cheers,David Larlet --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Not possible activate the admin site
Fernando Gutierrez wrote: > Did you svn update from previous trunk to magic-removal? I experienced > this because svn update left a directory urls in > django/contrib/admin/urls/, so i think there was some type of conflict > with the urls.py that is now directly in the django/contrib/admin/ > Yes, I had updated from previous trunk to magic-removal so that was the problem. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
capistrano/switchtower python equivalent?
hi, is there something similar to Capistrano (http://wiki.rubyonrails.com/rails/pages/Capistrano) in python? what i'm looking for is a tool which i can configure to do the release-process automatically.. mostly things like: - checkout the newest version of the source code on all the servers - adjust some config settings - restart apache - rollback to an older version etc. so before i start to code my custom python scripts... is there anything like this in python? or, did perhaps anyone try out Capistrano with python? gabor --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Change cols and row in generic update page textarea
Hi Folks, Wondering if there's a way to specify how many rows and columns the generic update page uses for a textarea? It seems to default to 10 and 40, and I'd like to make this much larger. Thanks, Tom --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Internalization: Two DB tables for one Model?
Hello Django Professionals! I am making a Django-based website that has to be multilingual. Everything is clear about making the admin section and the templates translatable. The problem is multilingual objects. I could think of several approaches to implement internationalization for Django objects: 1. Use special tagging inside the translatable fields, i.e. <%en%>Title<%/en%><%de%>Titel<%/de%><%lt%>Pavadinimas<%/lt%> (this is not usable for common people, administrating the site and tricky for implementing searches and other functionalities) 2. Create class attributes for every single translatable field, i.e. title_en = models.TextField(verbose_name=_("English Title")); title_de = models.TextField(verbose_name=_("German Title")); title_lt = models.TextField(verbose_name=_("Lithuanian Title")); (it's not flexible, because you can't add languages dynamically) 3. Create a separate DB table for every model that has translatable fields The table would contain - model_id - translatable fields (title, description) - language_id (or code) (I find this way the most proper for implementing multilingual objects, but.. (read further)) One way to have a separate table for a model is to have a separate model for translatable fields and One to Many relationship between the models. i.e. class ItemLng(models.Model): product = models.ForeignKey(Item); language = models.CharField(maxlength=5, choices=LANGUAGES, verbose_name=_("language")) title = models.CharField(maxlength=200, core=True, verbose_name=_("title")) description = models.TextField(verbose_name=_("description")) Then you can use tabular views in the administration to edit those translatable fields. (is it possible to restrict administrator from inserting two different versions of translations for the same language?) This may be OK until you start using tabular views for the primary objects. Let's take the example with Polls. Poll has children PollLng and Option, whereas Option has children OptionLng. As it is impossible to use two levels of tabular views, either Poll has to be edited separately from its Options, or Options has to be edited separately from their translated fields. And that makes no sense. So, I think, there should be a way to bound two database tables for one model. If you have an example or suggestions how to do that, or you have some suggestions how to implement translatable objects in another way, please respond to this email. Mr. Aidas Bendoraitis --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: User Defined Fields in django
Hello, I appreciate the suggestion, but I think that would give up all the usefullness of the framework for those fields. Also, for reporting purposes the data really needs to be in standard database tables, columns and rows. I think I'm going to hack around in the code a bit and see if I can patch it to get the behavior I need since this doesn't seem to be a common problem. Thanks, -Chirs --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
order_with_respect_to and edit_inline in MR
Hi, I switched my code over to M-R this past weekend and was surprised that it went pretty smoothly. There are a couple things in my models that aren't working anymore though. The first is order_with_respect_to. I have an inline edited object that I want to order with respect to its related object. I have this in my model: class Link(models.Model): date = models.ForeignKey(NewsList, edit_inline = models.TABULAR) ... class Meta: order_with_respect_to = 'date' I have dom-drag.js in the appropriate place, but ordering isn't working in the admin interface anymore. I could probably figure this out by diving into the source but was hoping someone could give me a quick answer here first. Even when I remove dom-drag, it doesn't display an ordering box like it used to. The other thing that doesn't work anymore is customizing the edit_inline interface by subclassing BoundRelatedObject. I remember mention back in February that Jacob was working on changing this, but I haven't been following the list closely enough to keep up with this and I can't find anything from searching the archive. Thanks for your help! Colleen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Change cols and row in generic update page textarea
You mean in the admin page or using a generic view? with the generic view you can specify your HTML, so I don't see a problem there. If you want to add this information to the admin pages, that cannot be done at the moment (please someone correct me if I am wrong), but it would only be a small patch to django/db/models/fields/__init__.py ( add rows and cols params to TextField.__init__() and pass those on to LargeTextField in get_manipulator_field_objs() ) would anyone be interested in this patch? On 6/6/06, tomass <[EMAIL PROTECTED]> wrote: > > Hi Folks, > > Wondering if there's a way to specify how many rows and columns the > generic update page uses for a textarea? > > It seems to default to 10 and 40, and I'd like to make this much > larger. > > Thanks, Tom > > > > > -- Honza Král E-Mail: [EMAIL PROTECTED] ICQ#: 107471613 Phone: +420 606 678585 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Change cols and row in generic update page textarea
This is for a generic view. I may have missed this in the doc, but how do I specify my html? I'm currently doing: EmailBody: {{ form.emailbody }} {% if form.emailbody.errors %}*** {{ form.emailbody.errors|join:", " }}{% endif %} And this is what punches out the: How can I control what cols and rows this outputs? Thanks, Tom --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Change cols and row in generic update page textarea
simply put there instead of the template tag {{ form.emailbody }} not very ellegant, but works.. On 6/6/06, tomass <[EMAIL PROTECTED]> wrote: > > This is for a generic view. I may have missed this in the doc, but how > do I specify my html? > > I'm currently doing: > > EmailBody: {{ form.emailbody }} > {% if form.emailbody.errors %}*** {{ form.emailbody.errors|join:", > " }}{% endif %} > > And this is what punches out the: > > name="emailbody" rows="10" cols="40"> > > How can I control what cols and rows this outputs? > > Thanks, Tom > > > > > -- Honza Král E-Mail: [EMAIL PROTECTED] ICQ#: 107471613 Phone: +420 606 678585 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Change cols and row in generic update page textarea
But how do I show the value of the field in the textarea: is there such as thing as {{ form.emailbody.value }} or something? This is for an update form, so I need to display the current value Thanks, Tom --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Help with multiple object added on a single form with addManipulator.
Thanks but that's not what I was looking for. I wasn't interested in the admin. I was interested in manipulators (http://www.djangoproject.com/documentation/forms/), which allow you access to bits of the admin's framework. I was having trouble writing a form to submit both an object and several related objects. Say that I want to write a form so a user can add a recipe and several ingredients. When messing about with objects in the shell On 01/06/06, canen <[EMAIL PROTECTED]> wrote: > > http://www.djangoproject.com/documentation/tutorial2/#adding-related-objects > > I think that may be what you are looking for. > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Ajax support, there is no need for reinventing the wheel
What is 'lack of ajax support'? We couldn't make ajax fodder with templates? We couldn't just slap to one or another pretty ajax lib? Looks like this is the question of lazyness. I'm pretty happy now with my tiny jah.js + data from generic views and heard about some nice ajax packages. So what is this buzz about? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Help with multiple object added on a single form with addManipulator.
Oops, I just accidently hit send to early there. Anyway, when messing around with the manipulators in the shell and generate them as shown at http://code.djangoproject.com/wiki/NewAdminChanges I get a dictionary called _related_objects (or something like that) but I am unable to access it in the templates. I've hacked around this for the moment but I would like to know the Right Way(TM) of doing this. Thanks, Frankie On 06/06/06, Frankie Robertson <[EMAIL PROTECTED]> wrote: > Thanks but that's not what I was looking for. I wasn't interested in > the admin. I was interested in manipulators > (http://www.djangoproject.com/documentation/forms/), which allow you > access to bits of the admin's framework. I was having trouble writing > a form to submit both an object and several related objects. Say that > I want to write a form so a user can add a recipe and several > ingredients. When messing about with objects in the shell > > On 01/06/06, canen <[EMAIL PROTECTED]> wrote: > > > > http://www.djangoproject.com/documentation/tutorial2/#adding-related-objects > > > > I think that may be what you are looking for. > > > > > > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Upgrading to Magic-Removal
Thanks for your help. My hosting company was able to correct the issue and install the magic-removal version. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Nose about future
On 6/6/06, Nagy Károly <[EMAIL PROTECTED]> wrote: > > 1. what are those areas of api or framework where we encounter major > rewrites interfacing with it > 2. arrival time of 1.0 This is the most up to date plan for 1.0 http://code.djangoproject.com/wiki/VersionOneFeatures When will it be released? I don't think anyone really knows including the lead devs. Joseph --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Serious Noobie question, what the $ for in urlpatterns.
Op ma, 05-06-2006 te 21:44 -0500, schreef Jeremy Dunck: > Kodos is a nice utility for fiddling with regexs: 'Kiki' is another one, written in wxPython. -- Jan Claeys --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Nose about future
On 06/06/06, Nagy Károly <[EMAIL PROTECTED]> wrote: > *snip* > 2. arrival time of 1.0 I believe "When it's ready" is the staple answer. > I do not try to play a sure game (wish i can do), just estimating amount > of troubles. > > Thanks, > Charlie. > > -- > "...s minden mestert kinevettem, ki nem nevetett önmagán." > GPG public key: http://www.rendszergazda.com/gpg/charlie-gpg-public-key.asc > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Change cols and row in generic update page textarea
On 6/6/06, tomass <[EMAIL PROTECTED]> wrote: > Wondering if there's a way to specify how many rows and columns the > generic update page uses for a textarea? > > It seems to default to 10 and 40, and I'd like to make this much > larger. Hi Tom, Each form element gets an ID in its HTML, which you can target that via a CSS rule. If your field is called "foo", the ID will be "id_foo", and you can target it with this CSS: #id_foo { width: 300px; height: 200px; } Adrian -- Adrian Holovaty holovaty.com | djangoproject.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Easy way to access extra User stuff in templates?
I've extended User by providing extra fields (a middle name, preferred nickname, etc.) in a UserInfo model with a User foreign key. I've also written methods for UserInfo for things like formalName () and informalName(). Here's the problem: How do I get to those in a template? I know there's only one UserInfo object per User object, and ideally I'd like to type something like {{ user.userinfo.formalName }} in the template, but this doesn't work because userinfo is actually userinfo_set and I'd need to get the first element of that. I don't think that's possible in the templating language, but I'd be happy to be wrong. I don't want to stick userinfo into the context if I can possibly avoid it. Do I just need to wait until one-to-one relationships work? Thanks, Todd --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Easy way to access extra User stuff in templates?
On 6/6/06, Todd O'Bryan <[EMAIL PROTECTED]> wrote: > Here's the problem: How do I get to those in a template? I know > there's only one UserInfo object per User object, and ideally I'd > like to type something like > > {{ user.userinfo.formalName }} > > in the template, but this doesn't work because userinfo is actually > userinfo_set and I'd need to get the first element of that. I don't > think that's possible in the templating language, but I'd be happy to > be wrong. Get happy! :) {{ user.userinfo_set.0.formalName }} Adrian -- Adrian Holovaty holovaty.com | djangoproject.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Catching a failed response
Jay Parlar wrote: >What I'd like is that if the client closes their browser, >some exception gets raised, and I can cancel the rest of the process >on the server side. > > Ah... This is interesting :-). A web server will know that a client has been disconnected only when it will try to send it something. So if you have a long working view you can't know if it works for nothing until it finishes. It's good when you can do calculations and push results to the client iteratively. Then you can create an iterator and pass it to a HttpResponse. It then will call your code until it's done or an error writing data to the client occured. It looks like this: def long_process(): while not done: data_chunk = calculate_data_chunk() yield data_chunk def some_view(request): return HttpResponse(long_process()) P.S. In mod_python you can actually catch the write error in Dango's core/handlers/modpython.py because the loop iterating over response's iterator is there in 'populate_apache_response'. However in general case (WSGI) it's outside of Django and is not accessible. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Easy way to access extra User stuff in templates?
On Jun 6, 2006, at 11:03 AM, Adrian Holovaty wrote: > > On 6/6/06, Todd O'Bryan <[EMAIL PROTECTED]> wrote: >> Here's the problem: How do I get to those in a template? I know >> there's only one UserInfo object per User object, and ideally I'd >> like to type something like >> >> {{ user.userinfo.formalName }} >> >> in the template, but this doesn't work because userinfo is actually >> userinfo_set and I'd need to get the first element of that. I don't >> think that's possible in the templating language, but I'd be happy to >> be wrong. > > Get happy! :) > > {{ user.userinfo_set.0.formalName }} > Why is it that you can't find stuff until after you send an email asking about it? I actually implemented a context processor, added a TEMPLATE_CONTEXT_PROCESSORS to my settings.py and then noticed the line I had missed about list lookup. (Actually, to slightly complicate things, I tried user.userinfo_set[0].formalName first, but that's another story.) Thanks. I'll just go over here in the corner and play by myself. Todd --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Easy way to access extra User stuff in templates?
On 6/6/06, Todd O'Bryan <[EMAIL PROTECTED]> wrote: > Why is it that you can't find stuff until after you send an email > asking about it? > > I actually implemented a context processor, added a > TEMPLATE_CONTEXT_PROCESSORS to my settings.py and then noticed the > line I had missed about list lookup. (Actually, to slightly > complicate things, I tried user.userinfo_set[0].formalName first, but > that's another story.) No problem at all, Todd. A template context processor would be another way to do it. Slightly cleaner, if you don't like the "user.userinfo_set.0" all over the place. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
FileFields, MEDIA_ROOT, and private media
I've got an unusual situation with an app, and I'm wondering if anyone could make a suggestion. The app will have a number of file upload fields for uploading files that are _not_ supposed to be made available to the webserver (as they are private). I'd like for particular FileFields to be able to upload to somewhere that is not a subdirectory of MEDIA_ROOT. The obvious solution is to just set MEDIA_ROOT to someplace that is not visible to the webserver (making MEDIA_URL somewhat irrelevant), and let the webserver serve media from someplace else, that Django doesn't know about. I can do this if I have to. However, I'd like to be able to use my apps that require this setup in the same project as more typical apps that need MEDIA_ROOT to be visible to the webserver. So, is there some straightforward way to put file uploads outside of MEDIA_ROOT? Should I write my own field class for the purpose? Move the file someplace else in the model's save() method? Use the normal setup, but lock down that subdirectory of MEDIA_ROOT in the webserver's configuration? Something else? -- ++ | Jason F. McBrayer [EMAIL PROTECTED] | | "If you wish to make Pythocles wealthy, don't give him more | | money; rather, reduce his desires."-- Epicurus | --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: FileFields, MEDIA_ROOT, and private media
On 6/6/06, Jason F. McBrayer <[EMAIL PROTECTED]> wrote: > So, is there some straightforward way to put file uploads outside of > MEDIA_ROOT? Should I write my own field class for the purpose? Move > the file someplace else in the model's save() method? Use the normal > setup, but lock down that subdirectory of MEDIA_ROOT in the > webserver's configuration? Something else? Are you using the Django admin for the file uploads? If not, you can just write your own views that upload the data to a place of your choosing. You'd be dealing with request.FILES for this. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Nose about future
Joseph Kocherhans írta: >This is the most up to date plan for 1.0 > > http://code.djangoproject.com/wiki/VersionOneFeatures > > Thanks, i did not see. Charlie. -- "...s minden mestert kinevettem, ki nem nevetett önmagán." GPG public key: http://www.rendszergazda.com/gpg/charlie-gpg-public-key.asc --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: FileFields, MEDIA_ROOT, and private media
"Adrian Holovaty" <[EMAIL PROTECTED]> writes: > Are you using the Django admin for the file uploads? If not, you can > just write your own views that upload the data to a place of your > choosing. You'd be dealing with request.FILES for this. Unfortunately (?), I am using the Django admin for the file uploads -- they are (potentially private) attachments to a wiki-like model, and I'd like to leverage the admin for as much as possible. Another possibility that occurs to me would be to use mod_rewrite to redirect-away requests for that subdirectory of MEDIA_ROOT, but on the other hand, I'd like to be as webserver-agnostic as possible. -- +---+ | Jason F. McBrayer[EMAIL PROTECTED] | | A flower falls, even though we love it; and a weed grows, | | even though we do not love it.-- Dogen| --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Sanitizing user input
Hi, I wonder what's the preferred way/best practice for sanitizing user input. Most fields of my models are not allowed to contain HTML tags or javascript. I could use the striptags filter inside my templates but I feel more like sanitizing it before entering the database. I could use the django.utils.html.strip_tags function inside the save function of my models, but it seems foolish to me to add this kind of sanitizing for allmost all of my fields (not DRY). Cheers, Rudolph --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
confused again: a "home page" can't be some special case
I'm still trying to wrap my head around some basic ideas. I appreciate the patience that has been extended my way already. Having pounded through the tutorial, I have a decent idea of how the poll app works, with a URL being associated with a function in the Poll app's view. That function then does its business, including indicating how to render the page through some template, etc. (And of course there's a whole lot more going on, most of which I hope to understand some day.) Where I am stuck now is with the idea of a page that displays a little of this and a little of that, a collection of widgets and blocks of content, a page that doesn't clearly belong to something like the tutorial's Poll app, but might display the newest poll, the newest 5 news items, a few photos from a gallery, etc. What would sort of function/view might the URL for that page be associated with? It doesn't feel like there would be a specific app just for doing that kind of aggregating, but the mental map I am carrying around so far seems to require it. Would I just make (an arbitrary(?)) choice to put a function that kicks things off *somewhere* and then get to a template that does some inclusion of other templates? I hope I'm explaining myself well. Thanks again. Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: confused again: a "home page" can't be some special case
let's clarify: you have now: myproject polls photos gigs and want to make it all appear at main page right? like this +--+ | home page| +---+--+ | photo gallery | Polls | | | | | | | | | | +---+--+ | next gigs | +---+ you can: 1) create a homepage app to aggregate it all (don't be worried, it can live without any models) 2) use whatever app you have, and throw a index() merging it together just my 2cents On 6/6/06, David Robinson <[EMAIL PROTECTED]> wrote: > > I'm still trying to wrap my head around some basic ideas. I appreciate > the patience that has been extended my way already. > > Having pounded through the tutorial, I have a decent idea of how the > poll app works, with a URL being associated with a function in the Poll > app's view. That function then does its business, including indicating > how to render the page through some template, etc. (And of course > there's a whole lot more going on, most of which I hope to understand > some day.) > > Where I am stuck now is with the idea of a page that displays a little > of this and a little of that, a collection of widgets and blocks of > content, a page that doesn't clearly belong to something like the > tutorial's Poll app, but might display the newest poll, the newest 5 > news items, a few photos from a gallery, etc. What would sort of > function/view might the URL for that page be associated with? It > doesn't feel like there would be a specific app just for doing that kind > of aggregating, but the mental map I am carrying around so far seems to > require it. Would I just make (an arbitrary(?)) choice to put a function > that kicks things off *somewhere* and then get to a template that does > some inclusion of other templates? I hope I'm explaining myself well. > Thanks again. > > Dave > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: FileFields, MEDIA_ROOT, and private media
If Django follows symbolic links on upload (and you're running linux), you could use a symbolic link in the directory that would point to wherever you'd like to store the files. Just make sure your apache configuration is set to not follow symbolic links and you're set. Just a thought. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: confused again: a "home page" can't be some special case
On 6/6/06, Douglas Campos <[EMAIL PROTECTED]> wrote: > 1) create a homepage app to aggregate it all (don't be worried, it can > live without any models) > 2) use whatever app you have, and throw a index() merging it together 3) Have it "belong" to one particular app/model, and use templatetags to pull out other content. I do this on my personal site; the home page is the "archive_index" generic view, wired up to my blog entries, then I have the rest of the dynamic content pulled out by templatetags. -- "May the forces of evil become confused on the way to your house." -- George Carlin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: confused again: a "home page" can't be some special case
Another option is to create it as a flat page with the url "/" and pull in all your content using template tags. On 6/6/06, James Bennett <[EMAIL PROTECTED]> wrote: > > On 6/6/06, Douglas Campos <[EMAIL PROTECTED]> wrote: > > 1) create a homepage app to aggregate it all (don't be worried, it can > > live without any models) > > 2) use whatever app you have, and throw a index() merging it together > > 3) Have it "belong" to one particular app/model, and use templatetags > to pull out other content. > > I do this on my personal site; the home page is the "archive_index" > generic view, wired up to my blog entries, then I have the rest of the > dynamic content pulled out by templatetags. > > -- > "May the forces of evil become confused on the way to your house." > -- George Carlin > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Change cols and row in generic update page textarea
Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: FileFields, MEDIA_ROOT, and private media
> I've got an unusual situation with an app, and I'm wondering if anyone > could make a suggestion. The app will have a number of file upload > fields for uploading files that are _not_ supposed to be made > available to the webserver (as they are private). I'd like for > particular FileFields to be able to upload to somewhere that is not a > subdirectory of MEDIA_ROOT. I made it work by: 1) Create two separate media directories: /media/public and /media/restricted 2) Configure Apache to serve /media/public directory directly 3) Configure Apache to serve the /media/restricted directory using mod_python 4) Set a url entry in urls.py to e.g.: (r'^media/restricted/(?P.*)','myproject.myapp.views.view_restricted_media') 5) Create view_restricted_media as: @restrict_to_superuser def view_restricted_media(request,path): return static.serve(request,path,RESTRICTED_MEDIA_DIR) 6) If you want to be able to set files from unrestricted to restricted or the other way around, create a function to move the file from the public media subdir to the restricted one and vice-versa. The advantage of this approach is that you can restrict the media files to whatever you may need, and the media files will still be available in the admin interface. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Django Article on Developerworks
IBM has just posted an article on mine on the IBM website (hasn't made it to the front page, yet): http://www-128.ibm.com/developerworks/linux/library/l-django/ If you notice any errors, kindly send them to me via email and I will see if I can get them fixed. Thanks to all of the contributors of this great software... I hope this article gains the project some additional exposure. regards, Ian --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Additional controls in admin interface?
Excuse me if this is a daft question -- I'm new to both Python and Django, but I guess it's a credit to both of them that I'm doing some fairly nifty stuff building a new corporate intranet. One feature I'd like to add is a meeting scheduler, where someone can set up a meeting and invite various people to it. The ManyToManyField selector in the "Event" admin view has a couple of drawbacks, afaics: 1. It doesn't sort the names of the people in the list, so finding a name is awkward. 2. It's a bit awkward to use, since it has about 150 names in it. I'd much prefer to use something like the "User Permission" dialog on the "Change user" admin page. Is there a way to do this? If so, I'd appreciate some clues. TIA. -- James M --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Additional controls in admin interface?
You're looking for the "filter_interface" option for the ManyToManyField. You can find out more here: http://www.djangoproject.com/documentation/model_api/#many-to-many-relationships Also, if you specify an ordering meta option on your model, your ManyToManyField will be sorted by the field you specify: http://www.djangoproject.com/documentation/model_api/#ordering Cheers, Wilson On 6/6/06, James Mulholland <[EMAIL PROTECTED]> wrote: > > Excuse me if this is a daft question -- I'm new to both Python and > Django, but I guess it's a credit to both of them that I'm doing some > fairly nifty stuff building a new corporate intranet. > > One feature I'd like to add is a meeting scheduler, where someone can > set up a meeting and invite various people to it. The ManyToManyField > selector in the "Event" admin view has a couple of drawbacks, afaics: > > 1. It doesn't sort the names of the people in the list, so finding a > name is awkward. > 2. It's a bit awkward to use, since it has about 150 names in it. > > I'd much prefer to use something like the "User Permission" dialog on > the "Change user" admin page. Is there a way to do this? If so, I'd > appreciate some clues. TIA. > > -- > James M > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django Article on Developerworks
On 6/6/06, Ian Maurer <[EMAIL PROTECTED]> wrote: > IBM has just posted an article on mine on the IBM website (hasn't made > it to the front page, yet): > > http://www-128.ibm.com/developerworks/linux/library/l-django/ > > If you notice any errors, kindly send them to me via email and I will > see if I can get them fixed. Sweet! One thing I noticed is that the article should encourage the use of __str__(), not __repr__(), on models. This is something we changed in magic-removal. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Change cols and row in generic update page textarea
Or specify the dimensions in ems if you want a closer equivalent to rows and columns. On 6/6/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 6/6/06, tomass <[EMAIL PROTECTED]> wrote: > > Wondering if there's a way to specify how many rows and columns the > > generic update page uses for a textarea? > > > > It seems to default to 10 and 40, and I'd like to make this much > > larger. > > Hi Tom, > > Each form element gets an ID in its HTML, which you can target that > via a CSS rule. > > If your field is called "foo", the ID will be "id_foo", and you can > target it with this CSS: > > > #id_foo { width: 300px; height: 200px; } > > > Adrian > > -- > Adrian Holovaty > holovaty.com | djangoproject.com > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django Article on Developerworks
On 6/6/06, Ian Maurer <[EMAIL PROTECTED]> wrote: > If you notice any errors, kindly send them to me via email and I will > see if I can get them fixed. Couple things I noticed: * The "most recent Python" is 2.3.5? ;) * Right below Listing 9, tt mentions using __repr__ on a model, but the admin now uses __str__ instead for greater consistency with Python conventions. -- "May the forces of evil become confused on the way to your house." -- George Carlin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Additional controls in admin interface?
Wilson, thanks -- that answers both issues. Really appreciate your website, btw: it was one of the reasons I started learning to use 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 group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: confused again: a "home page" can't be some special case
Just like James Bennett, I would use templatetags for suchs "blocks" with little bits of information. I even generate a menu by using a templatetag. Rudolph --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Easy way to access extra User stuff in templates?
On 06/06/06 17:11, Todd O'Bryan wrote: > On Jun 6, 2006, at 11:03 AM, Adrian Holovaty wrote: > >> >> On 6/6/06, Todd O'Bryan <[EMAIL PROTECTED]> wrote: >>> Here's the problem: How do I get to those in a template? I know >>> there's only one UserInfo object per User object, and ideally I'd >>> like to type something like >>> >>> {{ user.userinfo.formalName }} >>> >>> in the template, but this doesn't work because userinfo is actually >>> userinfo_set and I'd need to get the first element of that. I don't >>> think that's possible in the templating language, but I'd be happy to >>> be wrong. >> >> Get happy! :) >> >> {{ user.userinfo_set.0.formalName }} >> > > Why is it that you can't find stuff until after you send an email > asking about it? > > I actually implemented a context processor, added a > TEMPLATE_CONTEXT_PROCESSORS to my settings.py and then noticed the > line I had missed about list lookup. (Actually, to slightly > complicate things, I tried user.userinfo_set[0].formalName first, but > that's another story.) > > Thanks. I'll just go over here in the corner and play by myself. > Todd > Wouldn't that be a use case for djangos built in (but hardly documented) AUTH_PROFILE_MODULE setting? e.g. settings.py: -- AUTH_PROFILE_MODULE = 'common.UserProfile' myproject.common.models.py: -- class UserProfile(models.Model): user = models.ForeignKey(User) site = models.ForeignKey(Site, default=settings.SITE_ID, blank=True) nick = models.CharField(maxlength=32, blank=True, null=True) def informalName(self): return self.nick def formalName(self): return '%s %s' % (self.user.first_name, self.user.last_name) ... And then in views: request.user.get_profile().formalName() or in templates: {{ user.get_profile.formalName }} --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Easy way to access extra User stuff in templates?
On 6/6/06, Steven Armstrong <[EMAIL PROTECTED]> wrote: > Wouldn't that be a use case for djangos built in (but hardly documented) > AUTH_PROFILE_MODULE setting? This was just written up over here: http://www.b-list.org/weblog/2006/06/06/django-tips-extending-user-model :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: FileFields, MEDIA_ROOT, and private media
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > 1) Create two separate media directories: /media/public and > /media/restricted > 2) Configure Apache to serve /media/public directory directly > 3) Configure Apache to serve the /media/restricted directory using > mod_python > 4) Set a url entry in urls.py to e.g.: > > (r'^media/restricted/(?P.*)','myproject.myapp.views.view_restricted_media') > 5) Create view_restricted_media as: > @restrict_to_superuser > def view_restricted_media(request,path): > return static.serve(request,path,RESTRICTED_MEDIA_DIR) Thanks; I'll probably end up doing something very much like this. The only thing I'm not crazy about with this solution is that it is a little intensive on the webserver configuration; I prefer to make the webserver configuration as simple as possible and do more complex things on the application side. In this case, it's not too bad; I'll just have to document it adequately. Thanks again. -- +---+ | Jason F. McBrayer[EMAIL PROTECTED] | | A flower falls, even though we love it; and a weed grows, | | even though we do not love it.-- Dogen| --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: confused again: a "home page" can't be some special case
Rudolph and James Bennett, did you create your own custom templatetags? If so, how did you go about doing it? I've been working on building and adding menus to django templates that are populated with other content as well, and I'd be interested in learning about your approach. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: confused again: a "home page" can't be some special case
Douglas, James, Wilson, Rudolph: Thanks - that clears things up. It's quite encouraging to see that we were pretty much headed in a viable direction. Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Harness our collective opinions -- Digg Django
Hey everybody, The IBM Developer Works article about Django is a good opportunity to get us some more exposure. If you have a Digg account (digg.com), Digg it! http://digg.com/programming/Develop_for_the_Web_with_Python_Django_Web_Framework Adrian -- Adrian Holovaty holovaty.com | djangoproject.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Harness our collective opinions -- Digg Django
Adrian Holovaty wrote: > The IBM Developer Works article about Django is a good opportunity to > get us some more exposure. If you have a Digg account (digg.com), Digg > it! Also on reddit (reddit.com): http://programming.reddit.com/info/7bzf/comments -johnn --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Harness our collective opinions -- Digg Django
On 6/6/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > Hey everybody, > > The IBM Developer Works article about Django is a good opportunity to > get us some more exposure. If you have a Digg account (digg.com), Digg > it! > > http://digg.com/programming/Develop_for_the_Web_with_Python_Django_Web_Framework Lazaridis commented... http://digg.com/programming/Develop_for_the_Web_with_Python_Django_Web_Framework#c1900653 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Backing HTML 'Compnents'
I'm not sure if this has been discussed. My searches yielded no fruit. I have page components that are common across many of my pages. Here are a few of them: == A user specific menu, cached in the session. == A shopping cart, cached in the session. == A list of recently visited items, cached in the session. My current approach to making these objects available to a template is to have a 'base_dict(request)' function that returns a dictionary containing the common things under well known names (e.g., { 'menu': menu, 'cart': cart, 'recent_items': recent_items}). For each view which returns a response (not a redirect), I do: d = base_dict(request) d['item'] = selected_item # etc return render_to_response('item.html', d) The idea is to set up the base dictionary in the same way in anticipation of each page having the same common components. Is this something that other people find themselves doing? What is your comfort level with this approach versus a more independent component approach? In Django that might mean a template block which knows how to load it's own data (a la a Tiles controller?). I'm not arguing the merits of either, I'm just trying to guage whether my approach is common or whether there is a better way that I'm not aware of. Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Backing HTML 'Compnents'
On Tue, Jun 06, 2006 at 12:46:00PM -0700, Doug Van Horn wrote: > My current approach to making these objects available to a template is > to have a 'base_dict(request)' function that returns a dictionary > containing the common things under well known names (e.g., { 'menu': > menu, 'cart': cart, 'recent_items': recent_items}). > > For each view which returns a response (not a redirect), I do: > > d = base_dict(request) > d['item'] = selected_item > # etc > return render_to_response('item.html', d) Sounds more like something to use Middleware and ContextProcessors for to me. Use the Middleware to add it to the request, then the context processor to make it accessable in the templates. AIUI all of the generic views and render_to_response use RequestContext rather than Request, so you should be fine. Thanks, -- Brett Parker --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Backing HTML 'Compnents'
On 6/6/06, Doug Van Horn <[EMAIL PROTECTED]> wrote: > I have page components that are common across many of my pages. Here > are a few of them: > > == A user specific menu, cached in the session. > == A shopping cart, cached in the session. > == A list of recently visited items, cached in the session. > > My current approach to making these objects available to a template is > to have a 'base_dict(request)' function that returns a dictionary > containing the common things under well known names (e.g., { 'menu': > menu, 'cart': cart, 'recent_items': recent_items}). Sounds like the perfect use case for a custom template tag via the "inclusion tag" helper. http://www.djangoproject.com/documentation/templates_python/#inclusion-tags Adrian -- Adrian Holovaty holovaty.com | djangoproject.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: confused again: a "home page" can't be some special case
On 6/6/06, Mike <[EMAIL PROTECTED]> wrote: > Rudolph and James Bennett, did you create your own custom templatetags? > If so, how did you go about doing it? I've been working on building and > adding menus to django templates that are populated with other content > as well, and I'd be interested in learning about your approach. I'll be writing something about it on my blog the next day or two. -- "May the forces of evil become confused on the way to your house." -- George Carlin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
DateField and DateTimefield do not really validate
Hi, When providing an invalid date like 2006-2-31 to a DateField or DateTimeField, the validation doesn't catch that and an unhandled exception is raised. It shouldn't be too hard to validate for valid dates since you can rely on the Python datetime module. I think this is a bug, or at least a missing feature one expects to find in the validation thing. Rudolph --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: DateField and DateTimefield do not really validate
On 6/6/06, Rudolph <[EMAIL PROTECTED]> wrote: > When providing an invalid date like 2006-2-31 to a DateField or > DateTimeField, the validation doesn't catch that and an unhandled > exception is raised. It shouldn't be too hard to validate for valid > dates since you can rely on the Python datetime module. > > I think this is a bug, or at least a missing feature one expects to > find in the validation thing. You should probably log this: http://code.djangoproject.com/newticket --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django Article on Developerworks
The article is the top post on digg.com right now - well done :) John. On 6 Jun 2006, at 18:54, Adrian Holovaty wrote: > > On 6/6/06, Ian Maurer <[EMAIL PROTECTED]> wrote: >> IBM has just posted an article on mine on the IBM website (hasn't >> made >> it to the front page, yet): >> >> http://www-128.ibm.com/developerworks/linux/library/l-django/ >> >> If you notice any errors, kindly send them to me via email and I will >> see if I can get them fixed. > > Sweet! One thing I noticed is that the article should encourage the > use of __str__(), not __repr__(), on models. This is something we > changed in magic-removal. > > Adrian > > -- > Adrian Holovaty > holovaty.com | djangoproject.com > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django Article on Developerworks
On Jun 6, 2006, at 10:25 AM, Ian Maurer wrote: > > IBM has just posted an article on mine on the IBM website (hasn't made > it to the front page, yet): > > http://www-128.ibm.com/developerworks/linux/library/l-django/ Good job. > > If you notice any errors, kindly send them to me via email and I will > see if I can get them fixed. The import statements are duplicated in Listing 26. Don --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: FileFields, MEDIA_ROOT, and private media
On Jun 6, 2006, at 9:53 AM, Umbrae wrote: > > If Django follows symbolic links on upload (and you're running linux), > you could use a symbolic link in the directory that would point to > wherever you'd like to store the files. Just make sure your apache > configuration is set to not follow symbolic links and you're set. > > Just a thought. Just remember that not setting FollowSymLinks in Apache is a speed hit, as it has to do a stat() on every directory in your path to make sure it is not following a sym link. Done --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
syncdb capabilities
I understand that the "manage.py syncdb" command should create any non-existant tables, but should it also update any individual fields that have been added to a model/table? If the answer is no, which is what I'm seeing, any suggestions on making changes to the model fieldsets other than dropping the tables and re-syncing? Thanks in advance! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: syncdb capabilities
On 6/6/06, bahund <[EMAIL PROTECTED]> wrote: > I understand that the "manage.py syncdb" command should create any > non-existant tables, but should it also update any individual fields > that have been added to a model/table? > > If the answer is no, which is what I'm seeing, any suggestions on > making changes to the model fieldsets other than dropping the tables > and re-syncing? Hey bahund, The answer is no -- it doesn't (yet) handle schema upgrades, and the answer to your second question is here: http://www.djangoproject.com/documentation/faq/#if-i-make-changes-to-a-model-how-do-i-update-the-database Adrian -- Adrian Holovaty holovaty.com | djangoproject.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: syncdb capabilities
Thanks Adrian, I appreciate the speedy response ... and that all makes sense for the time being. Keep up the good work over there! bahund --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Serious Noobie question, what the $ for in urlpatterns.
WOW! and again WOW! Thank you all for your quick and thorough responses, I now have it, perfect Thanks again, John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Problem using django.contrib.sites
I wanted to try and make site that would take advantage of django.contrib.sites but I am having a problem. Both sites I have created are returning the same settings.SITE_ID (1). I created a very simple project and app that just has one model. I copied my settings.py file to a new file called settingsTwo.py and changed the SITE_ID to 2. I then created a 2nd site in the Django admin. I created a simple view that returned settings.SITE_ID to be displayed on the template. I then ran the following 2 commands to start the servers. django-admin.py runserver 127.0.0.1:8000 --settings=MySite.settings django-admin.py runserver 127.0.0.1:8001 --settings=MySite.settingsTwo No matter which url I go to, 127.0.0.1:8000 or 127.0.0.1:8001 the settings.SITE_ID is "1". Even if I only start up the settingsTwo server. I thought this might be an issue with the dev server, so I set up Apach + mod_python and got the exact same results. ServerName siteOne.localhost SetHandler python-program PythonHandler django.core.handlers.modpython PythonPath "['/home/jay/workspace'] + sys.path" SetEnv DJANGO_SETTINGS_MODULE MySite.settings PythonDebug On ServerName siteTwo.localhost SetHandler python-program PythonHandler django.core.handlers.modpython PythonPath "['/home/jay/workspace'] + sys.path" SetEnv DJANGO_SETTINGS_MODULE MySite.settingsTwo PythonDebug On I know I must be missing something but after reading http://www.djangoproject.com/documentation/sites/ 3 times, I just can't seem to figure out what. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django on Intel mac?
Oliver Kiessler wrote: > --- > > I also tried MysqlDB which compiles fine but throws a runtime error: > > macbookpro:~/mysite oliver$ python manage.py runserverValidating models... > Unhandled exception in thread started by > Traceback (most recent call last): > File > "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/Django-0.91-py2.4.egg/django/core/management.py", > line 757, in inner_run > validate() > File > "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/Django-0.91-py2.4.egg/django/core/management.py", > line 741, in validate > num_errors = get_validation_errors(outfile) > File > "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/Django-0.91-py2.4.egg/django/core/management.py", > line 634, in get_validation_errors > import django.models > File > "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/Django-0.91-py2.4.egg/django/models/__init__.py", > line 1, in ? > from django.core import meta > File > "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/Django-0.91-py2.4.egg/django/core/meta/__init__.py", > line 3, in ? > from django.core import db > File > "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/Django-0.91-py2.4.egg/django/core/db/__init__.py", > line 23, in ? > raise ImproperlyConfigured, "Could not load database backend: %s. > Is your DATABASE_ENGINE setting (currently, %r) spelled correctly? > Available options are: %s" % \ > django.core.exceptions.ImproperlyConfigured: Could not load database > backend: Failure linking new module: > /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/_mysql.so: > Symbol not found: _uncompress > Referenced from: > /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/_mysql.so > Expected in: dynamic lookup > . Is your DATABASE_ENGINE setting (currently, 'mysql') spelled > correctly? Available options are: 'ado_mssql', 'mysql', 'postgresql', > 'sqlite3' I'm fighting the same problem now trying to use MySQL with my Intel Mac. This particular error is because /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/_mysql.so was compiled for the PPC chipset. I've tried compiling from source for the i386 architecture, but am having no luck. :-( --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Site testing How-To
Does anybody have a best practice (or not-too-annoying practice) for testing? I think I'll use Selenium to test my site, but how should I change to a test database, populate the test database, etc.? Any insight appreciated, Todd --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
I think I'm doing something wrong...
...because Django can't be this horribly broken. I'm sure of that much. But I've been beating my head against the wall for quite some time now and worst of all, I've got a deadline. So here's me, on the mailing list. What I'm trying to accomplish here is a simple POST form that posts to the same view. Caching is turned off. I'm not using Django's template system, but Kid. However, this shouldn't be a problem. As for the version, then I did an svn update about five minutes ago, while this same problem has also been present on the version from last night and on the version from about two weeks ago. Anyhow, the code. URL: (r'^make/$', 'latestbooks.latest.views.make_sidebar'), HTML: Ainult samal paeval ilmunud raamatud Täna ja eile ilmunud raamatud Täna, eile ja üleeile ilmunud raamatud VIEW: def make_sidebar(request): print "POST.keys()", request.POST.keys() print "GET.keys()", request.GET.keys() RESULT: [07/Jun/2006 04:50:23] "POST /make HTTP/1.1" 301 0 POST.keys() [] GET.keys() [] [07/Jun/2006 04:50:23] "GET /make/ HTTP/1.1" 200 1063 [07/Jun/2006 04:50:23] "GET /media/latestbooks.css HTTP/1.1" 304 0 I have another view working where the request.GET dictionary gets constructed properly when I pass the query string in the URL itself. (e.g., /?foo=bar&and=etc) So I don't think it's problems with any settings as such. The problem might be in my form. However, the XHTML looks valid, from what I can tell. This is driving me nuts, and I don't mean in the funny pirate joke sort of way. Help? Elver --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django on Intel mac?
On 6/6/06, Greg Harman <[EMAIL PROTECTED]> wrote: > I've tried compiling from source for the i386 architecture, but am > having no luck. :-( What error are you getting? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: I think I'm doing something wrong...
On Wed, 2006-06-07 at 05:00 +0300, Elver Loho wrote: [...] > URL: > (r'^make/$', 'latestbooks.latest.views.make_sidebar'), > > HTML: > > > Ainult samal > paeval ilmunud raamatud > Täna ja eile ilmunud > raamatud > > Täna, eile ja üleeile ilmunud > raamatud > > > > > > VIEW: > def make_sidebar(request): > > print "POST.keys()", request.POST.keys() > print "GET.keys()", request.GET.keys() > > RESULT: > [07/Jun/2006 04:50:23] "POST /make HTTP/1.1" 301 0 > POST.keys() [] > GET.keys() [] > [07/Jun/2006 04:50:23] "GET /make/ HTTP/1.1" 200 1063 > [07/Jun/2006 04:50:23] "GET /media/latestbooks.css HTTP/1.1" 304 0 One thing I would suggest is to change your form action to submit to "/make/". The trailing slash will avoid the redirect you are seeing (the 301 response code). Note the warning in the HTTP/1.1 spec about redirects from POSTs here: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2 It looks like your POST is being resubmitted as a GET and the form values may well be being dropped in the process (unless the redirected URL shows them as converted to GET params). Malcolm --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: I think I'm doing something wrong...
On 6/6/06, Elver Loho <[EMAIL PROTECTED]> wrote: > Anyhow, the code. > > > URL: > (r'^make/$', 'latestbooks.latest.views.make_sidebar'), > > HTML: > Your form is pointing at /make, but your view is at /make/ (note the trailing slash). Django's CommonMiddleware is automatically adding the slash (according to the APPEND_SLASH setting), and POST data isn't transferred in redirects. Point the form action at /make/ (with the trailing slash) and your problem should be solved. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: I think I'm doing something wrong...
Elver, I haven't had much of a play with it, but I get much better results from your little test program if I add a trailing slash to the action field of your form. i.e. - + This avoids the redirect that Django sends when it receives a URL without a trailing slash, trashing your form information. David Adam [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@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: I think I'm doing something wrong...
Haha, three replies within two minutes. Sorry for the spam. David Adam [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@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: I think I'm doing something wrong...
Elver Loho wrote: > Sadly it seems you, along with so many, many others, have fallen into the easiest problem in the book. Your action address should have a following /. http://code.djangoproject.com/wiki/NewbieMistakes#POSTtoviewslosesPOSTdata -- --Max Battcher-- http://www.worldmaker.net/ "I'm gonna win, trust in me / I have come to save this world / and in the end I'll get the grrrl!" --Machinae Supremacy, Hero (Promo Track) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: I think I'm doing something wrong...
Darn, well, that fixed it :P And to think I had the same problem with TurboGears a while bak. Sheesh. Thanks, everyone! :) Elver On 6/7/06, Max Battcher <[EMAIL PROTECTED]> wrote: > > Elver Loho wrote: > > > > Sadly it seems you, along with so many, many others, have fallen into > the easiest problem in the book. Your action address should have a > following /. > > http://code.djangoproject.com/wiki/NewbieMistakes#POSTtoviewslosesPOSTdata > > -- > --Max Battcher-- > http://www.worldmaker.net/ > "I'm gonna win, trust in me / I have come to save this world / and in > the end I'll get the grrrl!" --Machinae Supremacy, Hero (Promo Track) > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django Article on Developerworks
Thanks guys for the feedback. Hopefully the changes will get incorporated tomorrow. Also, I like the art IBM put together for the front page of the linux section... http://www-128.ibm.com/developerworks/linux/ I hope it meets with the approval of the true fans of both Django's. regards, Ian On 6/6/06, Ian Maurer <[EMAIL PROTECTED]> wrote: > IBM has just posted an article on mine on the IBM website (hasn't made > it to the front page, yet): > > http://www-128.ibm.com/developerworks/linux/library/l-django/ > > If you notice any errors, kindly send them to me via email and I will > see if I can get them fixed. > > Thanks to all of the contributors of this great software... I hope > this article gains the project some additional exposure. > > regards, > Ian > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Site testing How-To
On Jun 6, 2006, at 6:42 PM, Todd O'Bryan wrote:Does anybody have a best practice (or not-too-annoying practice) for testing?I think I'll use Selenium to test my site, but how should I change to a test database, populate the test database, etc.?If you want to test your model relationships, I find that the tests you do in the python shell (creating objects and running queries) are great because they can be quickly cut and pasted into doctests, preserving your failed model explorations as future tests.For unit testing, you don't really need a database. You can always mock the database calls, because you're not testing the data or the database (if postgres is up, the database is working), you're testing your code's behavior to the data. When I first starting using testing methods, I was obsessed with having perfect test data, but quickly realized what I really want is perfect code. I don't really mean perfect, but the code should always be better than the data.When I write tests I try not to test django's code, it already has a test suite (hey, if a bug in django makes my code work, how or why should I care? Of course, when they fix the bug and my code breaks, well then I can write a test for it).twill is a great tool for automating web interaction. Twill works from a script (or command line). One good reference source is the test folder in django itself. And Greenpeace's custard/melt django project has an extensive test suite you can learn from (they use selenium as well).And for reference, chromatic's "Perl Testing: A Developer's Notebook" is a very good tutorial on testing methods, with a Perl slant.Info on a mock library for python:sourceforge.net/projects/python-mockHere's some good testing info using python:http://agiletesting.blogspot.com/Don --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Log file analyze
I am using django directly with python manage.py runserver. I do not need any apache between. Kim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Log file analyze
On 6/6/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I am using django directly with python manage.py runserver. I do not > need any apache between. Hi Kim, There's no way to alter the log output of Django's runserver. It's not intended to be used for production sites, so adding that functionality isn't within the scope of this project. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Site testing How-To
On Jun 6, 2006, at 11:10 PM, Don Arbow wrote: > For unit testing, you don't really need a database. You can always > mock the database calls, because you're not testing the data or the > database (if postgres is up, the database is working), you're > testing your code's behavior to the data. When I first starting > using testing methods, I was obsessed with having perfect test > data, but quickly realized what I really want is perfect code. I > don't really mean perfect, but the code should always be better > than the data. Except that a lot of what I'm doing has interacting pages. If user #1 makes a change in a page, user #2 should see the output differently when they visit another page. (For example, a teacher creates an assignment and a student then sees the new assignment when they go to the class home page.) So I'd really like to have a database backend for testing so that I can actually run the site through its paces with some test data to see if everything works the way it should. (In other words, make sure that I put stuff where it's supposed to be and get it out correctly.) I've been trying to figure out how I could have two settings files, one for the file I use when I'm just playing around with the site during development and another for testing that would start clean each time I run the tests. I thought about copying the settings.py file over and using the --settings= option to manage.py when I do runserver, but then I'd have to make changes to both files whenever I add a new app or anything like that. What I'd ideally like to do is create a testsettings.py module that would contain all the stuff in settings.py, but would override DATABASE_NAME, DATABASE_USER, etc. It seems like, given Python's amazing powers of introspection and the existence of functions like globals() and locals(), such a thing should be possible. I haven't found it, however. Does anyone know of a way to get all attributes of a module into another module while overriding just a few? Or am I making this too difficult? Todd --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Site testing How-To
On 6/6/06, Todd O'Bryan <[EMAIL PROTECTED]> wrote: > > Does anyone know of a way to get all attributes of a module into > another module while overriding just a few? I think you want tocreate something like testsettings.py, and in that file do something like: from myproject.settings import * then override the specific settings you want. It won't work with manage.py, but your tests should be able to just set the DJANGO_SETTINGS_MODULE env variable to use the myproject.testsettings module. Joseph --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---