Re: sync flickr to my django blog
HEllo group can anyone help me in this regard please... On Mar 4, 10:50 am, stranger <[EMAIL PROTECTED]> wrote: > hello group, > > First of all I would like to thank this community for helping me > in solve my doubts regarding django. And here I am again with another > one. > > I am creating my blog using django and I want to integrate myflickr > with my blog. I am using the code from here. > http://www.djangosnippets.org/snippets/299/ > > i have created an app 'photos' in apps folder. I have aflickrmodel > from the snippet above. Also I have flickrupdate.py(which uses > flickrlib.py) which is also in the snippet stated above. > > Now can anyone help me whats the next step to sync myflickrprofile > with my blog. In admin panel the photos app is showing up with all the > fields...But all the fields should be populated fromflickr... .Am I > right? --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Fwd: Saved&named searches
I'm not sure I follow, if you mean doing a mass update, that is being implemented in qs-rf, however I don't think you will be able to increment. On Mar 5, 10:07 pm, "Haroldo Stenger" <[EMAIL PROTECTED]> wrote: > Thank you for Django, this is great. > I'd like to implement a feature in my model, namely, being able to search a > table based on boolean criteria, and have these criteria saved for later > revision. Also, to be able to increment a score count in the positive search > hits targeted records. > Has this been attempted? > > thanks, haroldo. --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Fwd: Saved&named searches
Thank you for Django, this is great. I'd like to implement a feature in my model, namely, being able to search a table based on boolean criteria, and have these criteria saved for later revision. Also, to be able to increment a score count in the positive search hits targeted records. Has this been attempted? thanks, haroldo. --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Iteration not working inside template
On Thu, 2008-03-06 at 09:17 +0530, M.Ganesh wrote: > Hi, > > I've pasted a minimalist code here: http://dpaste.com/hold/38198/ > > Only the table caption and the table headers show-up in the web page. > The LunchEnrty_list.count also shows up correctly, but there are no > table rows. You are trying to iteratate over LunchEntries_list.all, but LunchEntries_list is defines as LunchEntries.objects.all(). Querysets, which is what LunchEntries_list is, do not have an all() method. Only model managers (LunchEntries.objects) have an all(). So drop the "all" bit in your tempate iteration. Malcolm -- Honk if you love peace and quiet. http://www.pointy-stick.com/blog/ --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Iteration not working inside template
You don't need the .all after the lunch entry list in the template. You already did that. Michael Newman On Mar 5, 2008, at 10:47 PM, "M.Ganesh" <[EMAIL PROTECTED]> wrote: > > Hi, > > I've pasted a minimalist code here: http://dpaste.com/hold/38198/ > > Only the table caption and the table headers show-up in the web page. > The LunchEnrty_list.count also shows up correctly, but there are no > table rows. > > What am I missing > > TIA > Regards Ganesh > > > > --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Only 3 weeks left for PostgreSQL Conference East
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 There are only three weeks left to register for the PostgreSQL Community Conference: East! The conference is scheduled on March 29th and 30th (a Saturday and Sunday) at the University of Maryland. Come join us as Bruce Momjian and Joshua Drake have a round table open to any PostgreSQL question from the community. If a round table isn't your cup of tea, visit our talks page where you can pick to learn from over 20 experts in the field. http://www.postgresqlconference.org/talks/ To register just point that old fashion web browser over to: http://www.postgresqlconference.org/ All registrations and sponsorships are donations to PostgreSQL via Software in the Public Interest, Inc., a 501(c)3 non-profit corporation. Thanks again to our Community Conference Sponsors: Organizational Sponsor Command Prompt, Inc. http://www.commandprompt.com/ Silver Sponsor EnterpriseDB http://www.enterprisedb.com Talk Sponsors Afilias http://www.afilias.org/ Continuent http://www.continuent.com/ Sun http://www.sun.com/ Truviso http://www.truviso.com/ Xtuple http://www.xtuple.com/ Meal Sponsors OTG http://www.otg-nc.com/ General Sponsor Emma http://www.myemma.com/ Sincerely, Joshua D. Drake - -- The PostgreSQL Company since 1997: http://www.commandprompt.com/ PostgreSQL Community Conference: http://www.postgresqlconference.org/ Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate PostgreSQL SPI Liaison | SPI Director | PostgreSQL political pundit -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFHz0IHATb/zqfZUUQRArwWAJ9Fs9rRFQzWt6UxeEt08xPNsgCzkgCcD7ga X2bZsOK5FtEXAJp61VbIJ5g= =AkSv -END PGP SIGNATURE- --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Iteration not working inside template
Hi, I've pasted a minimalist code here: http://dpaste.com/hold/38198/ Only the table caption and the table headers show-up in the web page. The LunchEnrty_list.count also shows up correctly, but there are no table rows. What am I missing TIA Regards Ganesh --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: location of CSS
> Funny that css and js are considered "static media". In the spirit > of templating they should be dynamic. I'm not quite sure what you mean. Typically the contents of CSS, Javascript, and image files don't change from request to request. Hence - "static media". In most cases requests for "static media" are handled by the web server simply returning the contents of requested media directly from a file on disk. I'm not saying there aren't valid cases for dynamically generating CSS, Javascript or even images, but this is far less common than the well-accepted paradigm of separating these resources from the application source entirely. You'd better come up with some pretty hefty processing power and memory if you're going to be handling each request for a page resource (of which there may be dozens) with the interpreter rather than falling back on the highly optimized web-server itself. > Therein lies the problem. I don't want to have one set of code for > the development server and another for ?. E.g., django code which > works for sqlite works for MySQL. You may have been confused by what I said or vice versa. Django is one of many cross-platform web frameworks out there. (Well, Django itself isn't inherently cross-platform. It runs on Python which is and the developers thankfully had the wisdom not to put any platform- specific dependencies into their implementation). Taking your example - the Django ORM supports multiple databases. What this means is that you code your schema and application logic against the Django Models and DB API, and you can run the same code against any of the databases Django supports. More generally, you can run the same Django code on any platform that supports Python 2.3+. I have a Windows development box but I run my production sites on Linux - it's the exact same code everywhere. Development wouldn't be very fun if you had to keep track of machine or OS specific bits for all the places your code might run. > I think I will explore using the template loader more creatively and > possibly recursively to produce inline css and js. I don't know exactly what problem you are trying to tackle. Again, there may be perfectly valid reasons why you are trying to adopt this type of strategy, but a strategy like this has serious implications for the future scalability and maintenance of your application. This user group and community are very helpful. If you can describe more about what you are trying to architect you'll get a lot of great pointers about best practices and the best manner in which to leverage the strengths of the framework. -Brian On Mar 5, 4:53 pm, Phillip Watts <[EMAIL PROTECTED]> wrote: > On Wednesday 05 March 2008 13:37:58 Brian Luft wrote: > > > Serving static media really has nothing to do with Django. > > Funny that css and js are considered "static media". In the spirit > of templating they should be dynamic. I would characterize them as > junk_patched_on_to_a_crappy_platform. But, Oh well. > > > Presumably > > your browser is reading the CSS file and making a request back to your > > web server for the file. You haven't told us anything about your web > > server configuration. What path is being requested to the server for > > the image file? How is your web server handling that request? > > > If you're using the development server, was there anything in the > > serving static media FAQ that you did not understand? > > Therein lies the problem. I don't want to have one set of code for > the development server and another for ?. E.g., django code which > works for sqlite works for MySQL. > > I think I will explore using the template loader more creatively and > possibly recursively to produce inline css and js. > > Thanks for all help. --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Generic Views: Variable Table Columns
Just to follow up for the archives. What I was after is a getattr filter for the templates. Searching djangosnippets.org has found a couple. This one seems to do what I need: http://www.djangosnippets.org/snippets/411/ Regards Darryl Darryl Ross wrote: Hey All, I'm using the generic views and trying to build a HTML table where both the rows and columns are generated dynamically. Simplified example follows. I am having a problem though in that I can't work out if it is possible to reference an attribute of a model using a template variable. In Smarty it would be something like {$model.$attribute} Is this possible in Django or am I going to have to write a template tag to do this for me? -D = urls.py = view_dict = { 'queryset': ContactGroup.objects.all(), 'template_name': 'generic_list.html', 'extra_context': { 'columns': ('id', 'name', 'description')}, } urlpatterns += patterns('django.views.generic.list_detail', ('^contact-groups/$', 'object_list', view_dict) ) = generic_list.html = {% extends "base.html" %} {% block content %} {% for column in columns %} {{ column|capfirst }} {% endfor %} {% for object in object_list %} {% for column in columns %} {{ object.column }} <- Problem is here {% endfor %} {% endfor %} {% endblock %} -- Darryl Ross Director AFOYI, "Information Technology Solutions" p 08 7127 1831 m 0400 206 443 f 08 8425 9607 e [EMAIL PROTECTED] signature.asc Description: OpenPGP digital signature
Re: IDE
On Thu, Mar 6, 2008 at 4:06 AM, gabriel <[EMAIL PROTECTED]> wrote: > > What do you think about : > > eclipse + plugins( pydev + html/css ) > eric4 + django plugin > SPE - is there plugin for django > > All of that around for-django usage? > I only used UliPad, and didn't used others, and I only use "print" to debug django, so I have no ideas about other editors. Sorry. -- I like python! UliPad <>: http://code.google.com/p/ulipad/ meide <>: http://code.google.com/p/meide/ My Blog: http://www.donews.net/limodou --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Documentation Project [No django directly related]
On Wed, Mar 5, 2008 at 3:52 PM, Grupo Django <[EMAIL PROTECTED]> wrote: > These anotations are not 100% real, I've been looking only for a few > hours documentation about them, I don't know all the features of each > system yet. reST has two advantages: 1. Django already supports it for auto-generated documentation. 2. It doesn't go directly to PDF, but it will convert to other useful formats that can go to PDF (e.g., LaTeX). -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: location of CSS
On Wednesday 05 March 2008 13:37:58 Brian Luft wrote: > Serving static media really has nothing to do with Django. Funny that css and js are considered "static media". In the spirit of templating they should be dynamic. I would characterize them as junk_patched_on_to_a_crappy_platform. But, Oh well. > Presumably > your browser is reading the CSS file and making a request back to your > web server for the file. You haven't told us anything about your web > server configuration. What path is being requested to the server for > the image file? How is your web server handling that request? > > If you're using the development server, was there anything in the > serving static media FAQ that you did not understand? Therein lies the problem. I don't want to have one set of code for the development server and another for ?. E.g., django code which works for sqlite works for MySQL. I think I will explore using the template loader more creatively and possibly recursively to produce inline css and js. Thanks for all help. --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: IDE
On Mar 5, 3:06 pm, gabriel <[EMAIL PROTECTED]> wrote: > What do you think about : > > eclipse + plugins( pydev + html/css ) > eric4 + django plugin > SPE - is there plugin for django Eclipse + Pydev extension (especially with the non-free remote debugger) is really handy, though I've found Eclipse eats memory like mad. I haven't tried the others, but would be most interested in hearing anyone else's opinions. --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: how to cache django javascript message file ('/jsi18n/') with apache (production setup)
On Wed, 2008-03-05 at 14:33 -0800, jfine wrote: > On Mar 5, 5:58 pm, "alain D." <[EMAIL PROTECTED]> wrote: > > Hi, > > > >If there a simple apache configuration that is know to make browser > > cache the javascript message file ('jsi18n') in a standard apache > > django production setup ? > > [snip] > > > To my django virtual host and then I get this headers in the reply : > > HTTP/1.1 200 OK > > Date: Wed, 05 Mar 2008 17:54:25 GMT > > Server: Apache > > Vary: Accept-Language,Cookie,Accept-Encoding > > Thank you for sending clear and precise information. I think the > problem lies with the Vary: header. Are you sure you want to tell the > cache that the javascript depends on the cookie? It has to depend on the localisation cookie. The jsi18n URL is mapped to the django.views.i18n.javascript_catalog view. This produces a file containing the translation strings for the requester's currently active language. Since the currently active language can be stored in the language cookie, the cache for that URL must depend vary on "cookie". This is fairly tricky to work around, since web pages need a single URL they can refer to in order to pull in the translation file, regardless of the user's active language choice for that particular request. Short version: it's pretty much impossible to cache that file directly. I have a couple of ideas to try and experiment with in the future, but it's not the highest priority item at the moment. Regards, Malcolm -- Borrow from a pessimist - they don't expect it back. http://www.pointy-stick.com/blog/ --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Documentation Project [No django directly related]
On 5 mar, 23:54, Tim Chase <[EMAIL PROTECTED]> wrote: > > I'm building a complex Web site using Django of course, and I > > have to start the documentation this week. I'd like some > > suggestions about this. I want to make the documentation > > available through the web and a PDF file. > > I've found that there are two over-arching categories of > documentation: > > -developer documentation > -end user documentation > > For the former, rest2html or some other means of extracting > docstrings is great. It may not offer PDF, but most developers > just want accurate, up-to-date, easy to reach information. > Docstrings do that, and there are tools to export a walk of your > .py files and emit programming documentation as HTML. I can't > say I find this terribly helpful, but some folks like it. One > key aspect is that it's intimately tied to the code. > > For the end-user documents, you're not tied so closely to the > code, but rather tied to user-experience/flow. You can include > screen-shots, add more hand-holding text, and do other such > niceties. For this, something that produces nicer documents is > in order: LaTeX and DocBook are the big contenders. You can > produce all sorts of output from these (HTML, PDF, PostScript, > and I understand there are even DocBook->LaTeX or Latex->DocBook > converters). As Alex's message notes, you can use HTML->PDF > converters. Personally, I merely tolerate PDF and much prefer > HTML, so it's my first choice of documentation medium. > > I've found mind-mapping software (many are available, but I've > taken to Vym[1]) helpful for organizing out the user > documentation. Some even have an export-to-$FORMAT > functionality, such as Vym's direct-to-HTML output. It also > supports direct-to-LaTeX, and since the file-format is just > zipped XML (plus supporting files), it wouldn't be too hard to > write an XSLT template to remap it to DocBook too. > > -tim > > [1]http://www.insilmaril.de/vym/ In my case it's end-user documentation, with a lot of screenshots. I think I'll give docbook a try, or maybe Latex, not sure right now. Thank you. --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Queryset returning unexpected results
Ahh ok. Something like this then? qset = (Q(tags__title__icontains=query) | Q(title__icontains=query)) results = Blog.objects.filter(qset).extra(LEFT OUTER JOIN tag ON blog.tag = tag.id) On Mar 5, 10:49 pm, Pigletto <[EMAIL PROTECTED]> wrote: > > Basically, the queryset in views.py will ONLY return results if that > > particular Blog has a Tag related to it. If I haven't specified a tag > > for a particular blog, it will NEVER appear in my results. > > > Any ideas? Is my query only getting results with both a TITLE and > > TAG_TITLE? > > You need 'left outer join' here. SQL query build with django ORM > doesn't use that in this kind of query. > I think you may try to use .extra() to do it. > > -- > Maciej Wisniowski --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Queryset returning unexpected results
Ahh ok, can I simply specify just the 'left outer join' part of the query or do I need need to write it myself I.E. SELECT from TABLE where XXX LEFT OUTER JOIN... On Mar 5, 10:49 pm, Pigletto <[EMAIL PROTECTED]> wrote: > > Basically, the queryset in views.py will ONLY return results if that > > particular Blog has a Tag related to it. If I haven't specified a tag > > for a particular blog, it will NEVER appear in my results. > > > Any ideas? Is my query only getting results with both a TITLE and > > TAG_TITLE? > > You need 'left outer join' here. SQL query build with django ORM > doesn't use that in this kind of query. > I think you may try to use .extra() to do it. > > -- > Maciej Wisniowski --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Documentation Project [No django directly related]
> I'm building a complex Web site using Django of course, and I > have to start the documentation this week. I'd like some > suggestions about this. I want to make the documentation > available through the web and a PDF file. I've found that there are two over-arching categories of documentation: -developer documentation -end user documentation For the former, rest2html or some other means of extracting docstrings is great. It may not offer PDF, but most developers just want accurate, up-to-date, easy to reach information. Docstrings do that, and there are tools to export a walk of your .py files and emit programming documentation as HTML. I can't say I find this terribly helpful, but some folks like it. One key aspect is that it's intimately tied to the code. For the end-user documents, you're not tied so closely to the code, but rather tied to user-experience/flow. You can include screen-shots, add more hand-holding text, and do other such niceties. For this, something that produces nicer documents is in order: LaTeX and DocBook are the big contenders. You can produce all sorts of output from these (HTML, PDF, PostScript, and I understand there are even DocBook->LaTeX or Latex->DocBook converters). As Alex's message notes, you can use HTML->PDF converters. Personally, I merely tolerate PDF and much prefer HTML, so it's my first choice of documentation medium. I've found mind-mapping software (many are available, but I've taken to Vym[1]) helpful for organizing out the user documentation. Some even have an export-to-$FORMAT functionality, such as Vym's direct-to-HTML output. It also supports direct-to-LaTeX, and since the file-format is just zipped XML (plus supporting files), it wouldn't be too hard to write an XSLT template to remap it to DocBook too. -tim [1] http://www.insilmaril.de/vym/ --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Queryset returning unexpected results
> Basically, the queryset in views.py will ONLY return results if that > particular Blog has a Tag related to it. If I haven't specified a tag > for a particular blog, it will NEVER appear in my results. > > Any ideas? Is my query only getting results with both a TITLE and > TAG_TITLE? You need 'left outer join' here. SQL query build with django ORM doesn't use that in this kind of query. I think you may try to use .extra() to do it. -- Maciej Wisniowski --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: how to cache django javascript message file ('/jsi18n/') with apache (production setup)
On Mar 5, 5:58 pm, "alain D." <[EMAIL PROTECTED]> wrote: > Hi, > >If there a simple apache configuration that is know to make browser > cache the javascript message file ('jsi18n') in a standard apache > django production setup ? [snip] > To my django virtual host and then I get this headers in the reply : > HTTP/1.1 200 OK > Date: Wed, 05 Mar 2008 17:54:25 GMT > Server: Apache > Vary: Accept-Language,Cookie,Accept-Encoding Thank you for sending clear and precise information. I think the problem lies with the Vary: header. Are you sure you want to tell the cache that the javascript depends on the cookie? Hope this help. -- Jonathan --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Documentation Project [No django directly related]
If you display the docs in html, you can use this to convert it to a pdf: http://www.htmltopdf.org/ On Mar 5, 3:52 pm, Grupo Django <[EMAIL PROTECTED]> wrote: > Hello, this is not directly related to django, but I'm pretty sure > someone could help me here. > I'm building a complex Web site using Django of course, and I have to > start the documentation this week. > I'd like some suggestions about this. > I want to make the documentation available through the web and a PDF > file. Ususally I use OpenOffice for this task, because I don't need > publish on the web. > I think OO is not the best option here because it's not easy > synchronize the OO document with the web. > I've been looking for alternatives, and I found three: > These anotations are not 100% real, I've been looking only for a few > hours documentation about them, I don't know all the features of each > system yet. > * DocBook: > - Pros: Export to html and PDF > - Cons: Complex and complicated, exporting would require a lot of > work in the templates > * rest2web: > - Pros: Simple > - Cons: No PDF exporting > * Trac: > - Pros: I already use Trac for the tickets, and the wiki is very > usefull > - Cons: No PDF exporting. > > What would you recommend me? I'm thinking about DocBook, but I'm > reluctant because is complicated and I don't know if I can easily > create a good template for the web and PDF and a combination of OO and > Trac would be hard to maintain as it need to be synchronized. > > Thank you. --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Documentation Project [No django directly related]
Hello, this is not directly related to django, but I'm pretty sure someone could help me here. I'm building a complex Web site using Django of course, and I have to start the documentation this week. I'd like some suggestions about this. I want to make the documentation available through the web and a PDF file. Ususally I use OpenOffice for this task, because I don't need publish on the web. I think OO is not the best option here because it's not easy synchronize the OO document with the web. I've been looking for alternatives, and I found three: These anotations are not 100% real, I've been looking only for a few hours documentation about them, I don't know all the features of each system yet. * DocBook: - Pros: Export to html and PDF - Cons: Complex and complicated, exporting would require a lot of work in the templates * rest2web: - Pros: Simple - Cons: No PDF exporting * Trac: - Pros: I already use Trac for the tickets, and the wiki is very usefull - Cons: No PDF exporting. What would you recommend me? I'm thinking about DocBook, but I'm reluctant because is complicated and I don't know if I can easily create a good template for the web and PDF and a combination of OO and Trac would be hard to maintain as it need to be synchronized. Thank you. --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Voici certains des sites Internet les plus intéressants -
On Wed, Mar 5, 2008 at 3:48 PM, abidjana <[EMAIL PROTECTED]> wrote: > > Voici certains des sites Internet les plus intéressants - > > http://ordinary-stars.blogspot.com/ > > http://ilaarijs.blogspot.com/ > > http://www.foundshit.com/ > > http://laughingducks.wordpress.com/ > > http://crummychurchsigns.blogspot.com/ > > http://www.mugshotdujour.com/ > > http://www.animalsgonesilly.com/ > > We kinda get the point. Can you please do yourself a favor and do anything better with your time than this ? --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
save() always ABORTs
I'm sure I'm missing something small/stupid here, but it has me stumped. I have a legacy database system which I'm writing some django applets for - up until now it has been purely read-only, but working on making something which can write as well. I've created a minimal test case here which replicates the problem (for me, at least). I have a model defined as: class TestOne(models.Model): id = models.IntegerField(primary_key=True) foo = models.CharField(max_length=80) class Meta: db_table = 'test_one' and created a table in the database (Postgres, using psycopg) to match (obviously w/ the normal DB, the tables are already there): create table test_one (id int4 primary key, foo varchar(80)); I try running the following code in a view: testing = TestOne(id=8, foo='blah') testing.save() and nothing happens. Looking at my postgres log, I see the following pattern: LOG: statement: SET DATESTYLE TO 'ISO' LOG: statement: BEGIN; SET TRANSACTION ISOLATION LEVEL READ COMMITTED LOG: statement: SET TIME ZONE 'America/Chicago' LOG: statement: SET client_encoding to 'UNICODE' LOG: statement: SELECT 1 FROM "test_one" WHERE "id"=8 LOG: statement: INSERT INTO "test_one" ("id","foo") VALUES (8,'blah') LOG: statement: ABORT No matter what I've tried, I'm always having the .save() trigger the ABORT, and it is unclear to me why that is. -J --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Permissions and login
> The reason for this is to ensure a consistent API: an unauthenticated > user is represented by an object with all the same methods and > attributes as an authenticated user, but set up to fail all > authentication and permission checks, as if the unauthenticated user > is simply a user who has no permissions or auth info whatsoever. Ok. Than, it is completely regular and secure for me just to put following: @permission_required('add_author') def veryImportantViewOnlySuperUser(request) very important code This is fine? --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Permissions and login
On Wed, Mar 5, 2008 at 2:53 PM, Monica Leko <[EMAIL PROTECTED]> wrote: > Why first condition? Why checking is user authenticated? Doesn't the > request.user.has_permit("polls.can_vote) already imply that user is > authenticated? Can anonymous users have permissions? If they can, > and if they can vote, why than checking for authentication? When the user is authenticated, 'request.user' is an instance of django.contrib.auth.models.User, is_authenticated() returns True, and has_perm() will return according to whether that user has a specific permission. When the user is not authenticated, 'request.user' is an instance of django.contrib.auth.models.AnonymousUser, is_authenticated() returns False, and has_perm() always returns False regardless of the permission. The reason for this is to ensure a consistent API: an unauthenticated user is represented by an object with all the same methods and attributes as an authenticated user, but set up to fail all authentication and permission checks, as if the unauthenticated user is simply a user who has no permissions or auth info whatsoever. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Queryset returning unexpected results
Hey, Ok I have a queryset that basically searches a model for both the title, and the title of related tags. File: views.py query = request.POST.get('blog', '') if query: qset = ( Q(tags__title__icontains=query) | Q(title__icontains=query) ) results = Blog.objects.filter(qset).distinct() else: results = Blog.objects.all() File: models.py class Tag(models.Model): title = models.CharField(maxlength=100) class Blog(models.Model): title = models.CharField(maxlength=100) tags = models.ManyToManyField(Tag, blank=True) Basically, the queryset in views.py will ONLY return results if that particular Blog has a Tag related to it. If I haven't specified a tag for a particular blog, it will NEVER appear in my results. Any ideas? Is my query only getting results with both a TITLE and TAG_TITLE? Cheers, Chris --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Permissions and login
In Django book, page 189, authors are using following code: def vote(request): if request.user.is_authenticated and request.user.has_permit("polls.can_vote"): #vote here else: return HttpResponse("") Why first condition? Why checking is user authenticated? Doesn't the request.user.has_permit("polls.can_vote) already imply that user is authenticated? Can anonymous users have permissions? If they can, and if they can vote, why than checking for authentication? --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Voici certains des sites Internet les plus intéressants -
Voici certains des sites Internet les plus intéressants - http://ordinary-stars.blogspot.com/ http://ilaarijs.blogspot.com/ http://www.foundshit.com/ http://laughingducks.wordpress.com/ http://crummychurchsigns.blogspot.com/ http://www.mugshotdujour.com/ http://www.animalsgonesilly.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?hl=en -~--~~~~--~~--~--~---
Voici certains des sites Internet les plus intéressants -
Voici certains des sites Internet les plus intéressants - http://ordinary-stars.blogspot.com/ http://ilaarijs.blogspot.com/ http://www.foundshit.com/ http://laughingducks.wordpress.com/ http://crummychurchsigns.blogspot.com/ http://www.mugshotdujour.com/ http://www.animalsgonesilly.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?hl=en -~--~~~~--~~--~--~---
Voici certains des sites Internet les plus intéressants -
Voici certains des sites Internet les plus intéressants - http://ordinary-stars.blogspot.com/ http://ilaarijs.blogspot.com/ http://www.foundshit.com/ http://laughingducks.wordpress.com/ http://crummychurchsigns.blogspot.com/ http://www.mugshotdujour.com/ http://www.animalsgonesilly.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?hl=en -~--~~~~--~~--~--~---
Voici certains des sites Internet les plus intéressants -
Voici certains des sites Internet les plus intéressants - http://ordinary-stars.blogspot.com/ http://ilaarijs.blogspot.com/ http://www.foundshit.com/ http://laughingducks.wordpress.com/ http://crummychurchsigns.blogspot.com/ http://www.mugshotdujour.com/ http://www.animalsgonesilly.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?hl=en -~--~~~~--~~--~--~---
Voici certains des sites Internet les plus intéressants -
Voici certains des sites Internet les plus intéressants - http://ordinary-stars.blogspot.com/ http://ilaarijs.blogspot.com/ http://www.foundshit.com/ http://laughingducks.wordpress.com/ http://crummychurchsigns.blogspot.com/ http://www.mugshotdujour.com/ http://www.animalsgonesilly.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?hl=en -~--~~~~--~~--~--~---
Re: Problems using cron to run a python script
Thanks for all the help folks! I solved the issue this morning by running the python script via a BASH script that source my BASH_PROFILE, which contains exports my PYTHONPATH. Here is what the script looked like: #!/bin/bash . ~/.bash_profile /usr/bin/python /home/user/path/to/django/app/update_feeds.py The file had write permissions set. And here is what the cron looked like: MAILTO="[EMAIL PROTECTED]" 1 * * * * /home/user/django/django_projects/myproject/feed_updater One things for sure, I need to get off Dreamhost. Their forum was crap, and the service ticket I put in didn't produce anything usable. On Mar 5, 5:35 am, Pigletto <[EMAIL PROTECTED]> wrote: > > OK, I'm getting a different error now: > > > Traceback (most recent call last): > > File "update_feeds.py", line 58, in ? > > update_feeds() > > File "update_feeds.py", line 14, in update_feeds > > from knoxd.apps.aggregator.models import Feed, FeedItem > > ImportError: No module named knoxd.apps.aggregator.models > > > I had added the following to mycron: > > > export PYTHONPATH=$PYTHONPATH:$HOME/lib/python2.3/site-packages > > > I'm assuming this solved the previous traceback issue.(?) > > You may see at the solution from webfaction > forum:http://forum.webfaction.com/viewtopic.php?id=1228 > > It works for me and I don't have to set any environment variables > incronsettings. > My script scheduler.py (that is called bycron) starts with the > following: > > # -*- coding: utf-8 -*- > import sys,os > import datetime > > sys.path.append('/home/svnSandbox/newforms-admin') > sys.path.append('/home/svnSandbox/blablabla/projects/xyz) > sys.path.append('/home/svnSandbox/blablabla/projects/xyz/apps') > os.environ['DJANGO_SETTINGS_MODULE'] xyz.settings' > > from django.core.management import setup_environ > import settings > setup_environ(settings) > > (...) > > Of course you have to set paths to fit your application layout. > > -- > Maciej Wisniowski --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: location of CSS
Serving static media really has nothing to do with Django. Presumably your browser is reading the CSS file and making a request back to your web server for the file. You haven't told us anything about your web server configuration. What path is being requested to the server for the image file? How is your web server handling that request? If you're using the development server, was there anything in the serving static media FAQ that you did not understand? On Mar 4, 12:34 pm, Phillip Watts <[EMAIL PROTECTED]> wrote: > On Tuesday 04 March 2008 12:38:25 Lewis Bergman wrote: > > > Where are your templates stored? > > currently, here > TEMPLATE_DIRS = ( > '/home/philproj/dirview/httemplates',) > but I have copies of dirview.css in that any every > other directory I could think of accessible to user phil. > > And, oh yeah, no slash on the end. That's inconsistent > with other settings like MEDIA_ROOT. > > > > > > > Phillip Watts wrote: > > > I can't figure out where to put css files or background images referred > > > to by css. I have: > > > > > > > and > > > MEDIA_ROOT = '/home/phil/philproj/media/' > > > > ls -al /home/phil/philproj/media > > > total 12 > > > drwxr-xr-x 2 phil phil 4096 2008-03-04 11:57 . > > > drwxr-xr-x 7 phil phil 4096 2008-03-04 12:14 .. > > > -rw-r--r-- 1 phil phil 96 2008-03-04 11:57 dirview.css > > > > I've tried everything? Help? Thanks- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: MEDIA_ROOT, what am I doing wrong?
On 3/5/08, Pete Crosier <[EMAIL PROTECTED]> wrote: > > I think you're over-estimating Django a little when it comes to > serving media - check out > http://www.djangoproject.com/documentation/static_files/ > for details, it requires a little more work. Woho, it works. Thank you very much. I thought i was going crazy. :) --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: IDE
What do you think about : eclipse + plugins( pydev + html/css ) eric4 + django plugin SPE - is there plugin for django All of that around for-django usage? Dnia 05-03-2008, śro o godzinie 22:22 +0800, limodou napisał(a): > On Wed, Mar 5, 2008 at 10:32 PM, gabriel <[EMAIL PROTECTED]> wrote: > > > > Hi , > > > > I am at the point of changing IDE before my next project ( a huge one ). > > So far I've used Geany for python but now I am supposed to use django. > > Is it anythong with special support for Django?? > > > > I know that recommendations include SPE and Eclipse but I wonder if you > > happened to work with IDE with a nice django support - does anything > > alike exist?? > > > > > You can try ulipad. Enable djangoproj plugin in [Tool]->[Plugin Manager...] > Alos need to set django project in Directory Browser Window(press F2, > and add your django project), the Set project menu item in context > menu of directory browser window. > --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: MEDIA_ROOT, what am I doing wrong?
I think you're over-estimating Django a little when it comes to serving media - check out http://www.djangoproject.com/documentation/static_files/ for details, it requires a little more work. On Mar 5, 6:19 pm, "Monica Leko" <[EMAIL PROTECTED]> wrote: > In settings.py I have: > MEDIA_ROOT = 'C:/Documents and > Settings/Monica/Desktop/aab/projekt/templates/media/' > > Media folder is in 'templates', and 'images' folder is in 'media'. > angry.gif is in 'images'. Following page, when requested, doesn't > show the image, only text "No image"?! I don't understand. > > > > > > No image > > > --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Advanced admin interface customization question
Actually, just thought of a third: 3. Basically the same as 2, but for the list view rather than the edit form. In other words, I want to be able to filter the list of locations by site as well as by neighborhood. Since the neighborhoods are associated with sites already it would be useful if when filtering the list by site the neighborhoods displayed were also filtered. --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
MEDIA_ROOT, what am I doing wrong?
In settings.py I have: MEDIA_ROOT = 'C:/Documents and Settings/Monica/Desktop/aab/projekt/templates/media/' Media folder is in 'templates', and 'images' folder is in 'media'. angry.gif is in 'images'. Following page, when requested, doesn't show the image, only text "No image"?! I don't understand. No image --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Advanced admin interface customization question
There are two ways in which I want to customize the admin interface for a project I'm working on. As far as I can tell, these sorts of customizations aren't built in, but before I start trying to write them myself I just want to make sure I'm not reinventing the wheel here. So, the two things I want to do are as follows: 1. This is a multi-site project, so most models have a site field. One particular model, locations, has a site field as well as a many-to- many relationship with the neighborhood model which also has a site field. What I want is that when editing a location object the neighborhoods that show up in the select box are only those neighborhoods that are related to the same site as the location being edited. 2. The location model also has a URL field which is non-required. I would like, when listing the locations in the admin interface, to be able to filter the view based on whether or not the location has a URL. Currently, if I just add that field as a filter it lists every single value of that field which isn't what I want (as there are several hundred values). Is there some easy built-in way to do either or both of these things that I'm just not aware of? --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Photologue 1.0 is out (image management application)
It looks great Justin. I'm already testing it. Thanks for sharing Tkm On 3/5/08, Justin <[EMAIL PROTECTED]> wrote: > > > Photologue 1.0b is out. The project page has been updated to reflect > the new 1.0 status and a new documentation site > http://sites.google.com/a/justindriscoll.us/photologue/Home is up and > (mostly) complete. If you use uploaded images in your project I think > you'll want to check this out. > > From the introduction: > > Photologue is a Django application, more specifically, it's a complete > image management solution for your Django site. Photologue replaces > the ImageField in Django with a powerful system that supports resizing > and image effects as well as providing a turn-key photo gallery > solution. Photologue embraces the Django admin and smoothly integrates > with photo thumbnails and effect previews. > > > - Justin > > > -- []s! Tkm http://djangopeople.net/brunotikami/ --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
how to cache django javascript message file ('/jsi18n/') with apache (production setup)
Hi, If there a simple apache configuration that is know to make browser cache the javascript message file ('jsi18n') in a standard apache django production setup ? I've tried to add : ExpiresActive on ExpiresDefault "access plus 1 month" To my django virtual host and then I get this headers in the reply : HTTP/1.1 200 OK Date: Wed, 05 Mar 2008 17:54:25 GMT Server: Apache Vary: Accept-Language,Cookie,Accept-Encoding Content-Type: text/javascript Content-Language: en-us Cache-Control: max-age=2592000 Expires: Fri, 04 Apr 2008 17:54:25 GMT Connection: close But my browser (firefox) keeps requesting this file for every (html) request that includes it ... Any idea ? Help ? Regards, Alan --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Photologue 1.0 is out (image management application)
Photologue 1.0b is out. The project page has been updated to reflect the new 1.0 status and a new documentation site http://sites.google.com/a/justindriscoll.us/photologue/Home is up and (mostly) complete. If you use uploaded images in your project I think you'll want to check this out. >From the introduction: Photologue is a Django application, more specifically, it's a complete image management solution for your Django site. Photologue replaces the ImageField in Django with a powerful system that supports resizing and image effects as well as providing a turn-key photo gallery solution. Photologue embraces the Django admin and smoothly integrates with photo thumbnails and effect previews. - Justin --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Thank you all for your overwhelming response.
Thank you all for your overwhelming response. In response to my below campaign and efforts the site has awarded me and my down line an opportunity to make 20$ + 6$ + 1$ right after the registration is done. So, in addition to 6$ opening Survey, you all have 5 more 4$ surveys totaling to an amount of 20$ and one more March special survey for 1$ (which will also make you eligible for a lucky draw of 500$ -- Try your luck). So in all you all can make 27$ in just 15 minutes. So out of the 75$ payout, you just need 48$ more to get the money into your paypal account. This will be as simple as inviting your friends to join in. You just need to invite 40 friends to join in and yippee, your account have 75 DOLLARS to be directly withdrawn!! Your friends can also earn 27$ on the first day itself. Just ask them to join in using links below. Website: http://snipr.com/survey-aw So what are you waiting for? !!! PLEASE READ THE BELOW INFORMATION TO MAKE OPTIMUM PROFIT !!! Note: Do read this till end and understand my point of view. This is not about interest! Our motto is to make money, without false claims. Hi Friends, Did you ever imagine if you get $75 in just 5 days by doing nothing at all ?? Yes, it is true! My friends reffered me this nice website. They have already earned more then 200$ in Just 2 months now and I too got my first 75$ Paypal Payment yesterday. I never believed such affiliate programs and also got disappointed with some like "ptr-trading", but this one is real and it sure pays. The simplest part of this program is to register, complete 1st survey and voila you are done! Then you may forget and just ask your friends to also join in with you. The more friends you join the faster you earn. No need of active participation or everyday login required here. But I am damn sure that after you pass some days, you will be quite imaptient to check your earnings update. Occasionally, you will find many surveys to fill in (less than 2 minutes job) and earn extra (a minimum is 4$). Maximum 1-2 questions per survey and you need to type no more than 15-20 words for each question. Now the trick, just go to this link, HERE, and click on "Create a Free Account". DO NOT register using a fake email ID and also do not register multiple using from a single machine/IP/email. They show you the IP address at the end of the registration form. If they detect any fallacy then your account will be disabled. Try to be true to yourself and submit valid email. If you are true, no body can stop you from earning !! This is their policy. The minimum payout is 75$. When you signup using the link, you will get a free referred survey to earn $6 directly on first shot. So just use THIS LINK and click on "Create a Free Account" to register. Then you can invite your friends to join and you can earn straight $1.25 for each of your friends that join. Simple, right! Please respect my research and straight information to earn easily on Internet. Please use this link to register. Warm Regards, Your well-wisher --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
initial value not working when used with SelectDateWidget
Hi, I want to show the current date in the Date field. It works 'SelectDateWidget' when I use the default widget. If I use 'SelectDateWidget' then I always get 1st January 2008. Is there a way to use 'SelectDateWidget' and still get current date in the input box? The code is pasted in the link below:http://dpaste.com/hold/38055/ Thanks in advance Regards Ganesh --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: reporting queryset-refactor bugs
On Mar 4, 4:13 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Tue, 2008-03-04 at 13:05 -0800, Dan Watson wrote: > > I guess this is mostly a question for Malcolm. Do you want people to > > start reporting bugs with the queryset-refactor branch, or would you > > rather hold off until things are a little more solidified? > > And is I say "no bug reports" you'll go back and close the bug report > you opened yesterday? :-) I figured I could get away with one, but had better ask before the second in 2 days ;) > You might as well report them. Worst case I just close them as a dupe. > My policy so far has been that if somebody reports something I already > know about haven't gotten to yet, I'll tend to leave it open as the > target for dupes. > > Just please search for duplicates before posting a ticket. If you're > going to be an early adopter, save all us some time by spending 5 or 10 > or 15 minutes checking to see if your issue already exists in the > system. Will do, and thanks for the great work! --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: initial value not working when used with SelectDateWidget
Ganesh - http://groups.google.com/group/django-users/post - try again ;D On Mar 5, 2:32 pm, "M.Ganesh" <[EMAIL PROTECTED]> wrote: > Hi, > > I want to show the current date in the Date field. It works > 'SelectDateWidget' when I use the default widget. If I use > 'SelectDateWidget' then I always get 1st January 2008. Is there a way to > use 'SelectDateWidget' and still get current date in the input box? The > code is pasted in the link below:http://dpaste.com/hold/38055/ > > Thanks in advance > Regards Ganesh --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
new to django
Hi everybody, I am new to django, I am planning to create my own tool using django. The tool is my learning practise to use Django in a better way. The tool i am planning is I need to upload files A,B which would give me the result as three files one is the A unique data, other is B unique data and A union B. I have normal python scripts. But I wish to put my learning efforts on django to learn it in a better way. Can somebody suggest me the way i can proceed using django for developing this tool. Thank you shafreen --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Play wide
Do you know the new widescreen LG? Watch it: http://www.golyofogo.extra.hu/ Play wide Play LG! --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Recovering from Postgres errors
A simpler question - is there any reason *not* to include this code in my model's save() method? try: Model.save(self) except DatabaseError: transaction.rollback_unless_managed() raise The benefits: - automatic recovery from failed unmanaged transactions - very handy when working in the shell, or when performing multiple updates that don't have to succeed or fail as a group - no effect when inside an explicit (managed) transaction Thanks, Kent --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: best practice to delete an object
On Wed, 2008-03-05 at 06:44 -0800, cesco wrote: > Hi, > > my question is really basic but I'd like to make sure I'm doing the > right thing. > > Say a user owns certain objects and it has the possibility to delete > them by clicking on a "delete" link. > > I'm thinking of associating that link to a get request via a url like: > /objects/delete/ > but this would give the possibility to a users to delete objects > created and belonging to another user by directly typing the url in > the bar and putting a random object_pk. > > What is the best practice to deal with this? > > Is it a good idea to simply check that the owner of the object is also > the one performing the get request? > > Would something like the following do the job? > if request.user.id == object.user.id: > object.delete() If permission control matters then of course you have to check the permissions before executing the operation. This isn't unique to delete(). However it's also not a universal requirement, since not every domain has a concept of objects being owned by anybody (or any group of bodies). So you need to do whatever permission checking is appropriate for your problem domain. Malcolm -- Honk if you love peace and quiet. http://www.pointy-stick.com/blog/ --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
best practice to delete an object
Hi, my question is really basic but I'd like to make sure I'm doing the right thing. Say a user owns certain objects and it has the possibility to delete them by clicking on a "delete" link. I'm thinking of associating that link to a get request via a url like: /objects/delete/ but this would give the possibility to a users to delete objects created and belonging to another user by directly typing the url in the bar and putting a random object_pk. What is the best practice to deal with this? Is it a good idea to simply check that the owner of the object is also the one performing the get request? Would something like the following do the job? if request.user.id == object.user.id: object.delete() Is there a well known approach? Thanks a lot Francesco --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
initial value not working when used with SelectDateWidget
Hi, I want to show the current date in the Date field. It works 'SelectDateWidget' when I use the default widget. If I use 'SelectDateWidget' then I always get 1st January 2008. Is there a way to use 'SelectDateWidget' and still get current date in the input box? The code is pasted in the link below: http://dpaste.com/hold/38055/ Thanks in advance Regards Ganesh --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: initial value not working when used with SelectDateWidget
I am sorry for hijacking this thread inadvertantly. I'll start another thread. Ganesh On Mar 5, 6:44 pm, "M.Ganesh" <[EMAIL PROTECTED]> wrote: > Hi, > > I want to show the current date in the Date field. It works > 'SelectDateWidget' when I use the default widget. If I use > 'SelectDateWidget' then I always get 1st January 2008. Is there a way to > use 'SelectDateWidget' and still get current date in the input box? The > code is pasted in the link below:http://dpaste.com/hold/38055/ > > Thanks in advance > Regards Ganesh --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: IDE
On Wed, Mar 5, 2008 at 10:32 PM, gabriel <[EMAIL PROTECTED]> wrote: > > Hi , > > I am at the point of changing IDE before my next project ( a huge one ). > So far I've used Geany for python but now I am supposed to use django. > Is it anythong with special support for Django?? > > I know that recommendations include SPE and Eclipse but I wonder if you > happened to work with IDE with a nice django support - does anything > alike exist?? > > You can try ulipad. Enable djangoproj plugin in [Tool]->[Plugin Manager...] Alos need to set django project in Directory Browser Window(press F2, and add your django project), the Set project menu item in context menu of directory browser window. -- I like python! UliPad <>: http://code.google.com/p/ulipad/ meide <>: http://code.google.com/p/meide/ My Blog: http://www.donews.net/limodou --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: IDE
I have been using OpenKomodo[1] and it seems to work pretty well with Django. [1] http://www.openkomodo.com/ On Wed, Mar 5, 2008 at 9:32 AM, gabriel <[EMAIL PROTECTED]> wrote: > > Hi , > > I am at the point of changing IDE before my next project ( a huge one ). > So far I've used Geany for python but now I am supposed to use django. > Is it anythong with special support for Django?? > > I know that recommendations include SPE and Eclipse but I wonder if you > happened to work with IDE with a nice django support - does anything > alike exist?? > > > Thanks for your answers, > Gabriel > > > > > --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
initial value not working when used with SelectDateWidget
Hi, I want to show the current date in the Date field. It works 'SelectDateWidget' when I use the default widget. If I use 'SelectDateWidget' then I always get 1st January 2008. Is there a way to use 'SelectDateWidget' and still get current date in the input box? The code is pasted in the link below: http://dpaste.com/hold/38055/ Thanks in advance Regards Ganesh --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Problem with SYNCDB
paste the database portion of settings.py It seems that you aren't connecting to your database properly. Are you specifying a port or the proper location of your socket? -- Justin Lilly Web Developer --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Problem with SYNCDB
On Wed, 2008-03-05 at 05:25 -0800, Nicola Greco di Notsecurity.com wrote: > I'm using debian, with apache (not apache2), when i launch this > command: python manage.py syncdb it appear: [...] > _mysql_exceptions.OperationalError: (2002, "Can't connect to local > MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)") Make sure you aren't being bitten by this: http://groups.google.com/group/django-users/browse_thread/thread/9204db1ac289a623/1ee1a2951347126b Regards, Malcolm -- The cost of feathers has risen; even down is up! http://www.pointy-stick.com/blog/ --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
IDE
Hi , I am at the point of changing IDE before my next project ( a huge one ). So far I've used Geany for python but now I am supposed to use django. Is it anythong with special support for Django?? I know that recommendations include SPE and Eclipse but I wonder if you happened to work with IDE with a nice django support - does anything alike exist?? Thanks for your answers, Gabriel --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Problem with SYNCDB
You need to make sure MySQL is up and running, and that the database settings in your settings file are correct - I've seen this error when I've simply forgotten to start MySQL. On Mar 5, 1:25 pm, "Nicola Greco di Notsecurity.com" <[EMAIL PROTECTED]> wrote: > I'm using debian, with apache (not apache2), when i launch this > command: python manage.py syncdb it appear: > > server:/home/admin/djbongo/aggregatore# python manage.py syncdb > Traceback (most recent call last): > File "manage.py", line 11, in ? > execute_manager(settings) > File "/usr/lib/python2.4/site-packages/django/core/management.py", > line 1672, in execute_manager > execute_from_command_line(action_mapping, argv) > File "/usr/lib/python2.4/site-packages/django/core/management.py", > line 1571, in execute_from_command_line > action_mapping[action](int(options.verbosity), > options.interactive) > File "/usr/lib/python2.4/site-packages/django/core/management.py", > line 492, in syncdb > _check_for_validation_errors() > File "/usr/lib/python2.4/site-packages/django/core/management.py", > line 1167, in _check_for_validation_errors > num_errors = get_validation_errors(s, app) > File "/usr/lib/python2.4/site-packages/django/core/management.py", > line 990, in get_validation_errors > db_version = connection.get_server_version() > File "/usr/lib/python2.4/site-packages/django/db/backends/mysql/ > base.py", line 127, in get_server_version > self.cursor() > File "/usr/lib/python2.4/site-packages/django/db/backends/mysql/ > base.py", line 99, in cursor > self.connection = Database.connect(**kwargs) > File "/usr/lib/python2.4/site-packages/MySQLdb/__init__.py", line > 75, in Connect > return Connection(*args, **kwargs) > File "/usr/lib/python2.4/site-packages/MySQLdb/connections.py", line > 164, in __init__ > super(Connection, self).__init__(*args, **kwargs2) > _mysql_exceptions.OperationalError: (2002, "Can't connect to local > MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)") > > someone can help me? --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Problem with SYNCDB
I'm using debian, with apache (not apache2), when i launch this command: python manage.py syncdb it appear: server:/home/admin/djbongo/aggregatore# python manage.py syncdb Traceback (most recent call last): File "manage.py", line 11, in ? execute_manager(settings) File "/usr/lib/python2.4/site-packages/django/core/management.py", line 1672, in execute_manager execute_from_command_line(action_mapping, argv) File "/usr/lib/python2.4/site-packages/django/core/management.py", line 1571, in execute_from_command_line action_mapping[action](int(options.verbosity), options.interactive) File "/usr/lib/python2.4/site-packages/django/core/management.py", line 492, in syncdb _check_for_validation_errors() File "/usr/lib/python2.4/site-packages/django/core/management.py", line 1167, in _check_for_validation_errors num_errors = get_validation_errors(s, app) File "/usr/lib/python2.4/site-packages/django/core/management.py", line 990, in get_validation_errors db_version = connection.get_server_version() File "/usr/lib/python2.4/site-packages/django/db/backends/mysql/ base.py", line 127, in get_server_version self.cursor() File "/usr/lib/python2.4/site-packages/django/db/backends/mysql/ base.py", line 99, in cursor self.connection = Database.connect(**kwargs) File "/usr/lib/python2.4/site-packages/MySQLdb/__init__.py", line 75, in Connect return Connection(*args, **kwargs) File "/usr/lib/python2.4/site-packages/MySQLdb/connections.py", line 164, in __init__ super(Connection, self).__init__(*args, **kwargs2) _mysql_exceptions.OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)") someone can help me? --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: change user admin template
Does anyone know how the django admin adds the "add group" button (small green plus sign) to the MultipleChoiceField "groups" on the "change user" interface? On Mar 4, 11:21 pm, Michael <[EMAIL PROTECTED]> wrote: > Right where you would expect it to be: > Django.Contrib.admin.templates > > You might want to look in django.contrib.auth.views to see what > template is being used. > > On Tue, Mar 4, 2008 at 11:41 AM, Rufman <[EMAIL PROTECTED]> wrote: > > > Hey > > > I can't seem to find the template that is displayed when I change a > > user (@www.example.com/example/admin/auth/user/1/). I'm fairly new to > > customizing the admin interface, so I might have overlooked > > something... > > > Stephane --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: python singletons
On Wed, 2008-03-05 at 02:40 -0800, Thierry wrote: > Basically the effect of implementing a singleton in php. > Not sharing anything between requests. > But sharing during on request. > > For instance you would have one javascript object, which you get > through getInstance() > It always returns the same object with a list of js files. > Then in the view or wherever you simply append or remove from the > list. > > Problem with my singleton approach is that it appends across requests. > So for every request I double the ammount of js it loads :) That's the way Python works: a module-level global (which is what you're creating) will exist for the life of the module, which is longer than one request. A more robust design pattern is to create this object that only has a request-based lifecycle inside the first view that needs it and pass it around as a parameter to the other functions that need it. Malcolm -- Depression is merely anger without enthusiasm. http://www.pointy-stick.com/blog/ --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: problems with url tag
On Tue, 2008-03-04 at 18:30 -0800, msoulier wrote: > So, my urlconf is > > urlpatterns = patterns('teleworker.clients.views', > (r'create/$', 'create'), > (r'modify/(?P\d+)/$', 'modify'), > (r'delete/(?P\d+)/$', 'delete'), > (r'page/(?P\d+)/(?P\w+)/(?P\w+)/$', > 'list'), > (r'page/(?P\d+)/$', 'list'), > (r'^$', 'list'), > ) > > The list function is > > def list(request, page=1, orderby='clientid', direction='forward', > filter=None): > > When I try to use the url tag to get a url to this function, it only > matches the last line of the urlconf. > > {% url teleworker.clients.views.list > page=1,orderby=clientid,direction=forward %} It's a slight bug in the reverse resolving system when their are non-unique matches. Ideally, it should have picked up the more specific match and/or match nothing if you pass in too many parameters. However, both of those are quite fiddly to introduce and keep the code simple. I'm slowly working on fixing this on my local machine, but it's not there yet. In the meantime, use the url(...) form for your url patterns and give each one that might cause confusion a unique name. That way you can refer to them uniquely in the {% url ... %} tag. Regards, Malcolm -- The hardness of butter is directly proportional to the softness of the bread. http://www.pointy-stick.com/blog/ --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Optimizing code for a query
> I need to optimize some code related to django db api. > Imagine a model like this: >> > class Languages( models.Model ): > name = models.CharField( max_length=255 ) > ... >> > class Object ( models.Model ): > name = models.CharField( max_length=255 ) > languages = models.ManyToManyField( Languages, radio_admin=True ) >> > I need to create a form to search Objects: > def my_view(request): > ... > if request.POST: > form = MyForm( request.POST ) > if form.is_valid(): > data = form.cleaned_data > objects = Object.objects.all() > if data['name']: > objects = objects.filter( name__icontains = > data['name'] ) > if data['languages']: > (1) > ... >> > I need to search an Object with name ILIKE %name% and with the > languages specified in the form. data['languages'] looks like: > [ u'1',u'2' ] the IDs of each language. >> > I needs some help with the code that should be placed in (1). > I thought: > > for language in languages: > objects = Object.filter( languages__id = language) >> > Well, my English is far from perfect, and I'm not really sure what you > mean, but what I want is to retrieve all the objects that have the > lenguages of the form. > i.e. > There are 2 languages in the model Language: English and Spanish. > o1 is an object with two relations to languages English and Spanish > 02 is an object with only one relation to language English > I need to get all the Objects that have English and Spanish, so only > o1 should be retrieved. > I hope this is clearer, sorry about the misunderstanding, sometimes > it's hard to say what I think :-) Yes, real life natural language can be more ambiguous than programming languages; but it's also more fun! It looks like you actually do want an 'AND' query (AND English AND Spanish), not OR, which is what I thought initially. And I'm pretty sure we could have this misunderstanding in Spanish as well, so it wouldn't have to do anything with your English being bad or good ;-). I would guess that you actually had the correct code initially, other than you were filtering on the model (Object) instead of the returned QuerySet. So, perhaps: result = Object.objects.filter(name__icontains=data['name']) for language in languages: result = result.filter(languages__pk=data['language']) (I've replaced 'id' with Django's 'pk' lookup shortcut; I assume you were looking and matching on the primary key). That should filter out any object that has has name ILIKE %data['name'] %, and links to language 1 AND language 2 AND language 3 and so on. But even if this works for you, I don't know any way to optimise it. Then again, I'm guessing it's pretty fast in itself already, which just a single for-loop. --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Optimizing code for a query
On 5 mar, 12:02, Grupo Django <[EMAIL PROTECTED]> wrote: > On 5 mar, 11:25, Evert Rol <[EMAIL PROTECTED]> wrote: > > > > > >>> I need to optimize some code related to django db api. > > >>> Imagine a model like this: > > > >>> class Languages( models.Model ): > > >>> name = models.CharField( max_length=255 ) > > >>> ... > > > >>> class Object ( models.Model ): > > >>> name = models.CharField( max_length=255 ) > > >>> languages = models.ManyToManyField( Languages, radio_admin=True ) > > > >>> I need to create a form to search Objects: > > >>> def my_view(request): > > >>> ... > > >>> if request.POST: > > >>> form = MyForm( request.POST ) > > >>> if form.is_valid(): > > >>> data = form.cleaned_data > > >>> objects = Object.objects.all() > > >>> if data['name']: > > >>> objects = objects.filter( name__icontains = > > >>> data['name'] ) > > >>> if data['languages']: > > >>> (1) > > >>> ... > > > >>> I need to search an Object with name ILIKE %name% and with the > > >>> languages specified in the form. data['languages'] looks like: > > >>> [ u'1',u'2' ] the IDs of each language. > > > >>> I needs some help with the code that should be placed in (1). > > >>> I thought: > > >>> > > >>> for language in languages: > > >>> objects = Object.filter( languages__id = language) > > > >> Have a look at 'in' > > >> filtering:http://www.djangoproject.com/documentation/db-api/#in > > >> Maybe that can help you out. The code above is certainly not going to > > >> work, because you try on the model, not the results returned from the > > >> managaer. Besides, you'd be filtering in an 'AND' combination, not > > >> 'OR' > > > > I can't use IN because it returns an Object that has any of the > > > languages requested. > > > Sorry, then I missed what you're trying to achieve; I guessed you > > wanted to have all languages specified by the form (shouldn't 'IN' > > return that?), and you can then filter those on the name by appending > > a .filter() to the returned QuerySet. > > At least, that's what I thought you wanted and would work. > > > > The SQL clause I need is: > > > select DISTINCT ... from app_object_languages as m2m INNER JOIN > > > app_object as ob ON ob.id = m2m.object_id where ( m2m.language_id=1 or > > > m2m.language_id=2); > > > > I can't get it! > > > Thank you for your help. > > Well, my English is far from perfect, and I'm not really sure what you > mean, but what I want is to retrieve all the objects that have the > lenguages of the form. > i.e. > There are 2 languages in the model Language: English and Spanish. > o1 is an object with two relations to languages English and Spanish > 02 is an object with only one relation to language English > I need to get all the Objects that have English and Spanish, so only > o1 should be retrieved. > I hope this is clearer, sorry about the misunderstanding, sometimes > it's hard to say what I think :-) > Thank you. I think I solved the problem: for language in data['languages']: objects = objects.extra(where=["EXISTS ( SELECT 0 FROM app_object_languages as m2m WHERE m2m.object_id = app_object.id AND m2m.language_id = %s )",], params=[ idioma ]) Thank you for your help. --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Optimizing code for a query
On 5 mar, 11:25, Evert Rol <[EMAIL PROTECTED]> wrote: > >>> I need to optimize some code related to django db api. > >>> Imagine a model like this: > > >>> class Languages( models.Model ): > >>> name = models.CharField( max_length=255 ) > >>> ... > > >>> class Object ( models.Model ): > >>> name = models.CharField( max_length=255 ) > >>> languages = models.ManyToManyField( Languages, radio_admin=True ) > > >>> I need to create a form to search Objects: > >>> def my_view(request): > >>> ... > >>> if request.POST: > >>> form = MyForm( request.POST ) > >>> if form.is_valid(): > >>> data = form.cleaned_data > >>> objects = Object.objects.all() > >>> if data['name']: > >>> objects = objects.filter( name__icontains = > >>> data['name'] ) > >>> if data['languages']: > >>> (1) > >>> ... > > >>> I need to search an Object with name ILIKE %name% and with the > >>> languages specified in the form. data['languages'] looks like: > >>> [ u'1',u'2' ] the IDs of each language. > > >>> I needs some help with the code that should be placed in (1). > >>> I thought: > >>> > >>> for language in languages: > >>> objects = Object.filter( languages__id = language) > > >> Have a look at 'in' > >> filtering:http://www.djangoproject.com/documentation/db-api/#in > >> Maybe that can help you out. The code above is certainly not going to > >> work, because you try on the model, not the results returned from the > >> managaer. Besides, you'd be filtering in an 'AND' combination, not > >> 'OR' > > > I can't use IN because it returns an Object that has any of the > > languages requested. > > Sorry, then I missed what you're trying to achieve; I guessed you > wanted to have all languages specified by the form (shouldn't 'IN' > return that?), and you can then filter those on the name by appending > a .filter() to the returned QuerySet. > At least, that's what I thought you wanted and would work. > > > The SQL clause I need is: > > select DISTINCT ... from app_object_languages as m2m INNER JOIN > > app_object as ob ON ob.id = m2m.object_id where ( m2m.language_id=1 or > > m2m.language_id=2); > > > I can't get it! > > Thank you for your help. Well, my English is far from perfect, and I'm not really sure what you mean, but what I want is to retrieve all the objects that have the lenguages of the form. i.e. There are 2 languages in the model Language: English and Spanish. o1 is an object with two relations to languages English and Spanish 02 is an object with only one relation to language English I need to get all the Objects that have English and Spanish, so only o1 should be retrieved. I hope this is clearer, sorry about the misunderstanding, sometimes it's hard to say what I think :-) Thank you. --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: python singletons
Basically the effect of implementing a singleton in php. Not sharing anything between requests. But sharing during on request. For instance you would have one javascript object, which you get through getInstance() It always returns the same object with a list of js files. Then in the view or wherever you simply append or remove from the list. Problem with my singleton approach is that it appends across requests. So for every request I double the ammount of js it loads :) --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Problems using cron to run a python script
> OK, I'm getting a different error now: > > Traceback (most recent call last): > File "update_feeds.py", line 58, in ? >update_feeds() > File "update_feeds.py", line 14, in update_feeds >from knoxd.apps.aggregator.models import Feed, FeedItem > ImportError: No module named knoxd.apps.aggregator.models > > I had added the following to my cron: > > export PYTHONPATH=$PYTHONPATH:$HOME/lib/python2.3/site-packages > > I'm assuming this solved the previous traceback issue.(?) You may see at the solution from webfaction forum: http://forum.webfaction.com/viewtopic.php?id=1228 It works for me and I don't have to set any environment variables in cron settings. My script scheduler.py (that is called by cron) starts with the following: # -*- coding: utf-8 -*- import sys,os import datetime sys.path.append('/home/svnSandbox/newforms-admin') sys.path.append('/home/svnSandbox/blablabla/projects/xyz) sys.path.append('/home/svnSandbox/blablabla/projects/xyz/apps') os.environ['DJANGO_SETTINGS_MODULE'] xyz.settings' from django.core.management import setup_environ import settings setup_environ(settings) (...) Of course you have to set paths to fit your application layout. -- Maciej Wisniowski --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Optimizing code for a query
>>> I need to optimize some code related to django db api. >>> Imagine a model like this: >> >>> class Languages( models.Model ): >>> name = models.CharField( max_length=255 ) >>> ... >> >>> class Object ( models.Model ): >>> name = models.CharField( max_length=255 ) >>> languages = models.ManyToManyField( Languages, radio_admin=True ) >> >>> I need to create a form to search Objects: >>> def my_view(request): >>> ... >>> if request.POST: >>> form = MyForm( request.POST ) >>> if form.is_valid(): >>> data = form.cleaned_data >>> objects = Object.objects.all() >>> if data['name']: >>> objects = objects.filter( name__icontains = >>> data['name'] ) >>> if data['languages']: >>> (1) >>> ... >> >>> I need to search an Object with name ILIKE %name% and with the >>> languages specified in the form. data['languages'] looks like: >>> [ u'1',u'2' ] the IDs of each language. >> >>> I needs some help with the code that should be placed in (1). >>> I thought: >>> >>> for language in languages: >>> objects = Object.filter( languages__id = language) >> >> Have a look at 'in' >> filtering:http://www.djangoproject.com/documentation/db-api/#in >> Maybe that can help you out. The code above is certainly not going to >> work, because you try on the model, not the results returned from the >> managaer. Besides, you'd be filtering in an 'AND' combination, not >> 'OR' > > I can't use IN because it returns an Object that has any of the > languages requested. Sorry, then I missed what you're trying to achieve; I guessed you wanted to have all languages specified by the form (shouldn't 'IN' return that?), and you can then filter those on the name by appending a .filter() to the returned QuerySet. At least, that's what I thought you wanted and would work. > The SQL clause I need is: > select DISTINCT ... from app_object_languages as m2m INNER JOIN > app_object as ob ON ob.id = m2m.object_id where ( m2m.language_id=1 or > m2m.language_id=2); > > I can't get it! > Thank you for your help. > > > --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Optimizing code for a query
On 5 mar, 10:52, Grupo Django <[EMAIL PROTECTED]> wrote: > On 4 mar, 11:40, Evert Rol <[EMAIL PROTECTED]> wrote: > > > > > > I need to optimize some code related to django db api. > > > Imagine a model like this: > > > > class Languages( models.Model ): > > >name = models.CharField( max_length=255 ) > > >... > > > > class Object ( models.Model ): > > >name = models.CharField( max_length=255 ) > > >languages = models.ManyToManyField( Languages, radio_admin=True ) > > > > I need to create a form to search Objects: > > > def my_view(request): > > >... > > >if request.POST: > > >form = MyForm( request.POST ) > > >if form.is_valid(): > > >data = form.cleaned_data > > >objects = Object.objects.all() > > >if data['name']: > > >objects = objects.filter( name__icontains = > > > data['name'] ) > > >if data['languages']: > > >(1) > > >... > > > > I need to search an Object with name ILIKE %name% and with the > > > languages specified in the form. data['languages'] looks like: > > > [ u'1',u'2' ] the IDs of each language. > > > > I needs some help with the code that should be placed in (1). > > > I thought: > > > > > > for language in languages: > > >objects = Object.filter( languages__id = language) > > > Have a look at 'in' > > filtering:http://www.djangoproject.com/documentation/db-api/#in > > Maybe that can help you out. The code above is certainly not going to > > work, because you try on the model, not the results returned from the > > managaer. Besides, you'd be filtering in an 'AND' combination, not 'OR' > > I can't use IN because it returns an Object that has any of the > languages requested. > The SQL clause I need is: > select DISTINCT ... from app_object_languages as m2m INNER JOIN > app_object as ob ON ob.id = m2m.object_id where ( m2m.language_id=1 or > m2m.language_id=2); > > I can't get it! > Thank you for your help. The SQL clause I wrote above is not valid. I messed it up sorry. I'm gonna try to relax myself and open my mind :-) Any suggestion is appreciated. --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Optimizing code for a query
On 4 mar, 11:40, Evert Rol <[EMAIL PROTECTED]> wrote: > > I need to optimize some code related to django db api. > > Imagine a model like this: > > > class Languages( models.Model ): > >name = models.CharField( max_length=255 ) > >... > > > class Object ( models.Model ): > >name = models.CharField( max_length=255 ) > >languages = models.ManyToManyField( Languages, radio_admin=True ) > > > I need to create a form to search Objects: > > def my_view(request): > >... > >if request.POST: > >form = MyForm( request.POST ) > >if form.is_valid(): > >data = form.cleaned_data > >objects = Object.objects.all() > >if data['name']: > >objects = objects.filter( name__icontains = > > data['name'] ) > >if data['languages']: > >(1) > >... > > > I need to search an Object with name ILIKE %name% and with the > > languages specified in the form. data['languages'] looks like: > > [ u'1',u'2' ] the IDs of each language. > > > I needs some help with the code that should be placed in (1). > > I thought: > > > > for language in languages: > >objects = Object.filter( languages__id = language) > > Have a look at 'in' > filtering:http://www.djangoproject.com/documentation/db-api/#in > Maybe that can help you out. The code above is certainly not going to > work, because you try on the model, not the results returned from the > managaer. Besides, you'd be filtering in an 'AND' combination, not 'OR' I can't use IN because it returns an Object that has any of the languages requested. The SQL clause I need is: select DISTINCT ... from app_object_languages as m2m INNER JOIN app_object as ob ON ob.id = m2m.object_id where ( m2m.language_id=1 or m2m.language_id=2); I can't get it! Thank you for your help. --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: problems with url tag
More than one match for one {% url view args %} doesn't sound right, you can name your patterns to clear up any ambiguity - http://www.djangoproject.com/documentation/url_dispatch/#naming-url-patterns On Mar 5, 2:30 am, msoulier <[EMAIL PROTECTED]> wrote: > So, my urlconf is > > urlpatterns = patterns('teleworker.clients.views', > (r'create/$', 'create'), > (r'modify/(?P\d+)/$', 'modify'), > (r'delete/(?P\d+)/$', 'delete'), > (r'page/(?P\d+)/(?P\w+)/(?P\w+)/$', > 'list'), > (r'page/(?P\d+)/$', 'list'), > (r'^$', 'list'), > ) > > The list function is > > def list(request, page=1, orderby='clientid', direction='forward', > filter=None): > > When I try to use the url tag to get a url to this function, it only > matches the last line of the urlconf. > > {% url teleworker.clients.views.list > page=1,orderby=clientid,direction=forward %} > > What am I missing? > > Thanks, > Mike --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---