Re: Backwards relation (ie XXX_set) across apps
On 9/9/06, Jay Parlar <[EMAIL PROTECTED]> wrote: I'll keep playing with it. This really *feels* like I've just screwedup something somewhere. I'll update if I find a solution.I've found the problem.Create an Article and Photo object in the admin view. Then, the following in the shell: >>> from testproject.mytest.models import Photo>>> Photo.objects.all()[0].article_set.all()throws Attribute Errorbut, if you then run:>>> from testproject.mytest2.models import Article>>> Photo.objects.all()[0].article_set.all()[]Until you import Article, the related objects for Photo aren't populated. This is a bit of a 'slaps forehead' moment for me - it's kinda obvious if you know the internals. However, I agree that it isn't obvious for end users. This is worth logging as a bug (if you would be so kind) - both in terms of 'this should be documented more clearly', and 'all related objects should automatically populated'. The first is easy to fix; I'm not so sure about the second. Yours,Russ Magee %-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Backwards relation (ie XXX_set) across apps
On 9/8/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > > > > On 9/9/06, Jay Parlar <[EMAIL PROTECTED]> wrote: > > > > Because 'stockphoto' appears before 'articles' in INSTALLED_APPS, > > could it be preventing the ORM from seeing the 'Article' model? > > > No - like I said before, this block of documentation is just describing the > reason that stockphoto needs to be defined in INSTALLED_APPS before > articles. > > Since Article has a direct dependency on Photo, Photo must be defined first. > The relationship between Photo and Article is implied; article_set is (or > should be :-) added to Photo when the Article model is loaded. Alright, that's what I thought. I'll keep playing with it. This really *feels* like I've just screwed up something somewhere. I'll update if I find a solution. Of course, any more suggestions (from anyone) are always welcome :) Jay P. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Backwards relation (ie XXX_set) across apps
On 9/8/06, Jay Parlar <[EMAIL PROTECTED]> wrote: Here's what I tried: Added a Photo and Article from the admin. In theshell, there was no 'article_set' attribute.Ok; I tried your models, and I got the same result. I'll look into this a little more and see if I can isolate the exact problem. Yours, Russ Magee %-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Uploading Files
On 9/8/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > how can I upload file to /media/images/1.jpg with Django? Start here: http://www.djangoproject.com/documentation/model_api/#imagefield If the admin interface is sufficient for you, you're done. Note that this requires an object/row per image. -- This message has been scanned for memes and dangerous content by MindScanner, and is believed to be unclean. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: How about a Django apps public repository?
Sean Schertell wrote: > > Any other contributors? I've got a handful of templatetags, which while somewhat outdated (built against ~0.91) should still be useful. I also have a (very) small forums app which I plan on expanding when I find the time, although it would need some cleanup to use outside of the site it's currently in. There are a couple of other things I've written up but one of them sucks and the other one is really just documentation which should go in a blog post or on the Django wiki. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: How about a Django apps public repository?
On 9/9/06, Sean Schertell <[EMAIL PROTECTED]> wrote: > > I'm willing to invest the time and bandwidth to get this thing off > the ground. And it sounds like a lot of folks would be happy to have > such a repository. But if we want to make it work, it has to have > some content from the very beginning. So how many of you actually > have code that you want to share? Anyone willing to make a commitment > to contribute apps if set this thing up? > > I'll start with the following three: > > Newsletter: A handy newsletter app for (opt-in) mass mailing > BasicAuth: A simpler authentication system for people who use a > custom admin site > StaticPages: A very lightweight request to template mapper (similar > to TemplatePages) > > Any other contributors? > > Sean > I have woodlog could be shared. -- I like python! My Blog: http://www.donews.net/limodou UliPad Site: http://wiki.woodpecker.org.cn/moin/UliPad UliPad Maillist: http://groups.google.com/group/ulipad --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Backwards relation (ie XXX_set) across apps
On 9/9/06, Jay Parlar <[EMAIL PROTECTED]> wrote: Because 'stockphoto' appears before 'articles' in INSTALLED_APPS,could it be preventing the ORM from seeing the 'Article' model?No - like I said before, this block of documentation is just describing the reason that stockphoto needs to be defined in INSTALLED_APPS before articles. Since Article has a direct dependency on Photo, Photo must be defined first. The relationship between Photo and Article is implied; article_set is (or should be :-) added to Photo when the Article model is loaded. Yours,Russ Magee %-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: How about a Django apps public repository?
I'm willing to invest the time and bandwidth to get this thing off the ground. And it sounds like a lot of folks would be happy to have such a repository. But if we want to make it work, it has to have some content from the very beginning. So how many of you actually have code that you want to share? Anyone willing to make a commitment to contribute apps if set this thing up? I'll start with the following three: Newsletter: A handy newsletter app for (opt-in) mass mailing BasicAuth: A simpler authentication system for people who use a custom admin site StaticPages: A very lightweight request to template mapper (similar to TemplatePages) Any other contributors? Sean On Sep 9, 2006, at 4:35 AM, Jeff Forcier wrote: > > Marc Fargas wrote: > >> I like the idea of the Cheeshop and more the one of different >> TRACs, but on >> the three options given, hosting TRACs is not as easy, Cheeshop >> and google >> are free.hosting a TRAC isn't. dejavu doesn't seem an option if >> you need to >> wait for an invite code for every project. > > Well, I would imagine that many other Djangonauts have their own > cheapish hosting that they use for personal websites or other > projects, > which are more than capable of handling Trac. I mean, I can't be the > only person who already has a $40/mo VPS with a ton of bandwidth > available, right? > > Unless the Django community is a lot bigger than I think it is, or my > estimates of the processing power needed to host a Trac site are way > off (both quite possible, of course) I'd wager I could host such a > system on my own resources, and I'd also wager there are folks out > there with more such resources available. > > Not everything has to be 100% free as in beer :) > > > > > > DataFly.Net Complete Web Services http://www.datafly.net --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Creating graphs in Django application
Thanks Joseph. You might find it interesting to take a look at our Diagra product datasheet... we've been in the financial charts business since 2001 http://www.reportlab.com/docs/diagra-ds.pdf The engine and most chart types have been in the open source package since 2001, but we've not really promoted it. Now that we're getting into Django, hopefully we'll get some nice examples out to inspire people.. - Andy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Creating graphs in Django application
there is also pyChart and JS/SVG PlotKit - http://www.liquidx.net/plotkit/ which is used by TurboGears :) NeedsTesting... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Re: Creating graphs in Django application
On 9/8/06, Andy Robinson <[EMAIL PROTECTED]> wrote: > > I have just added an article to the Wiki on how to create charts using > ReportLab's graphics library I hope this helps! > > http://code.djangoproject.com/wiki/Charts Very cool. Thanks Andy! I didn't know ReportLab did anything but pdf before :) Joseph --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: MySQL Django Wildcard bug...
On 8 Sep 2006, at 22:53, James Bennett wrote: > > On 9/8/06, tom smith <[EMAIL PROTECTED]> wrote: >> Then because the sql has a % in it.. django complains... > > The '%' needs to be escaped, because it's a special character in this > context. Make it '%%' (two percent signs in a row) and it should work > (and this isn't Django-specific AFAIK -- the syntax comes straight out > of the standard Python DB-API). Blimey!... thanks what a weird thing... I would NEVER have got that... Big big thanks! > "May the forces of evil become confused on the way to your house." ..as I generally do... er.. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: MySQL Django Wildcard bug...
On 09/08/06 22:56, tom smith wrote: > So... > > Because there aren't quite enough examples that show how to build > pythonic model queries... I'm using the pump-raw-sql at django... > > The only problem is that when my sql contains > > wordsql = wordsql + " AND (title not like ' %" + word +"%') " > > cursor.execute(sql) > > Then because the sql has a % in it.. django complains... > > "not enough arguments for format string" > > which I think is because the % is somehow being seen as a %s.. > > basically... pumping raw sql is fine unless theres a "%" in there... > > > any ideas? > Try escaping the %. e.g. wordsql = wordsql + " AND (title not like ' %%" + word +"%%') " --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Creating graphs in Django application
I have just added an article to the Wiki on how to create charts using ReportLab's graphics library I hope this helps! http://code.djangoproject.com/wiki/Charts Andy Robinson, CEO/Chief Architect, ReportLab Europe Ltd --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Diamanda Wiki and MyghtyBoard Forum on SVN now
On Thu, Sep 07, 2006 at 11:36:46PM +0800, limodou wrote: > On 9/7/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I don't want to make another mediawiki which requires to learn yet > > another markup language and needs a horde of wikipedians to controll > > it. > > So which text format do you think is the most familiar with people? I > think wiki format should be. I use reStructuredText_ quite a bit. I find it very easy to work with and it's part of the docutils_ package. Nate_ :) .. _reStructuredText: http://docutils.sf.net/rst.html .. _docutils: http://docutils.sf.net/ .. _Nate: http://refried.org/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: MySQL Django Wildcard bug...
On 9/8/06, tom smith <[EMAIL PROTECTED]> wrote: > Then because the sql has a % in it.. django complains... The '%' needs to be escaped, because it's a special character in this context. Make it '%%' (two percent signs in a row) and it should work (and this isn't Django-specific AFAIK -- the syntax comes straight out of the standard Python DB-API). -- "May the forces of evil become confused on the way to your house." -- George Carlin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
MySQL Django Wildcard bug...
So... Because there aren't quite enough examples that show how to build pythonic model queries... I'm using the pump-raw-sql at django... The only problem is that when my sql contains wordsql = wordsql + " AND (title not like ' %" + word +"%') " cursor.execute(sql) Then because the sql has a % in it.. django complains... "not enough arguments for format string" which I think is because the % is somehow being seen as a %s.. basically... pumping raw sql is fine unless theres a "%" in there... any ideas? thanks tom p.s or... how do I create a pythonic query where I a > v a < w b not like x b not like y b not like z c not like e --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Uploading Files
Hello, how can I upload file to /media/images/1.jpg with Django? Thak you for help. P.S. Sorry for may bad English ;-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django book...2...Apress
On 9/8/06, Daniele Spino <[EMAIL PROTECTED]> wrote: > Apress will publish "Pro Django: Web Development Done Right" | > 1590597257 | in Oct. 2006. Check out the book here: > http://www.apress.com/book/bookDisplay.html?bID=10176. Yeah, it's also been on Amazon for a while: http://tinyurl.com/rchx3 -- "May the forces of evil become confused on the way to your house." -- George Carlin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: How about a Django apps public repository?
Marc Fargas wrote: > I like the idea of the Cheeshop and more the one of different TRACs, but on > the three options given, hosting TRACs is not as easy, Cheeshop and google > are free.hosting a TRAC isn't. dejavu doesn't seem an option if you need to > wait for an invite code for every project. Well, I would imagine that many other Djangonauts have their own cheapish hosting that they use for personal websites or other projects, which are more than capable of handling Trac. I mean, I can't be the only person who already has a $40/mo VPS with a ton of bandwidth available, right? Unless the Django community is a lot bigger than I think it is, or my estimates of the processing power needed to host a Trac site are way off (both quite possible, of course) I'd wager I could host such a system on my own resources, and I'd also wager there are folks out there with more such resources available. Not everything has to be 100% free as in beer :) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Hierarchical menu for pages with nice formatting for selecting a parent
This code will generate a model that has a nice interface for people constructing sites organized around hierarchical menus. When adding a page, the current structure of the site shows up like this: root node -child node --child of a child node If a loop is detected during insertion, the page is moved to the root of the hierarchy. The code is probably terribly inefficient. I couldn't get the preorder traversal tree working to save my life, so I devised this. Let me know what you think. Dan from django.db import models, connection from django.db.models.query import Q import pprint weight_options = [] for item in range(-10,11): weight_options.append([item, item]) class Page(models.Model): parent = models.ForeignKey('self', null=True, blank=True) title = models.CharField(maxlength=100, core=True) slug = models.SlugField(help_text='Friendly URL', unique=True, prepopulate_from=('title',)) alias = models.CharField(blank=True, maxlength=100) weight = models.IntegerField(help_text='Lower weights show up earlier in lists. If items have the same weight, they are sorted by name.', default=0, choices=weight_options) body = models.TextField(blank=True, null=True) created = models.DateTimeField('Date Created', auto_now_add=True) modified = models.DateTimeField('Date Last Modified', auto_now=True) index = models.IntegerField(default=0, help_text='This field is used internally to properly arrange the menu. Please do not edit this field.') depth = models.IntegerField(default=0, help_text='This field is used to format the menu. Please do not edit this field.') class Admin: fields = ( ('Page', { 'fields' : ('title', 'body',) }), ('Menu', { 'fields' : ('parent', 'weight',) }), ('Advanced', { 'fields': ('slug', 'alias', 'index', 'depth',) , 'classes': 'collapse' }), ) list_display=('__str__', 'admin_links', 'created', 'modified',) list_filter=('modified', 'created',) search_fields=('title', 'body',) ordering=('index',) class Meta: ordering = ('index',) def get_absolute_url(self): if self.alias: return self.alias else: return '/pages/%s' % self.slug def admin_links(self): return 'edit | view | delete' % (self.id, self.get_absolute_url(), self.id) admin_links.allow_tags = True admin_links.short_description = 'Actions' def __str__(self): return '-' * self.depth + self.title def ancestors(self): list = [] page = self while page: if page in list: raise 'loop detected' list.append(page) page = page.parent return list def save(self): super(Page, self).save() # Make sure there are no loops in the hierarchy try: self.ancestors() except: self.parent = None # Call the super's save, so that the DB is correct before we modify it. super(Page, self).save() def get_order_recurse(parent, depth, index): pages = Page.objects.filter(parent=parent).order_by('weight') for page in pages: page.index = index page.depth = depth super(Page, page).save() index = get_order_recurse(page, depth + 1, index + 1) return index index = 0 pages = Page.objects.filter(parent__isnull=True).order_by('weight') for page in pages: page.index = index page.depth = 0 super(Page, page).save() index = get_order_recurse(page, 1, index + 1) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: How about a Django apps public repository?
I''ve been looking at some of the django projects at code.google.com and all I saw have empty subversion repositories... I like the idea of the Cheeshop and more the one of different TRACs, but on the three options given, hosting TRACs is not as easy, Cheeshop and google are free.hosting a TRAC isn't. dejavu doesn't seem an option if you need to wait for an invite code for every project.I'd rather stick on Cheeshop and keep a listing on code.djangoproject.com also the idea of keeping all small chunks like templatetags,filters and so in a single project seems really reasonable.my 0.02Marc.On 9/8/06, Jeff Forcier <[EMAIL PROTECTED]> wrote: >From exploring Google Code a short bit, I'm not positive it's the bestmedium, at least if we want any decent discussion or Web-baseddocumentation. Yes, one could hold discussions via the Issues, butthat's pretty gimpy for any discussion that does not fit well as a trouble ticket. And one could just have "local" documentation in asfiles included with the source code, but that's also not ideal, IMO.I guess in my mind a Djangoforge would be a collection of Trac instances (see e.g. code.djangoproject.com), where each project has awiki for discussion and documentation, source code management, etc.That would work best for a collection of full apps. It works less well for smaller, more atomic items like templatetags, although I supposeone would just collect those into a handful of other Tracs (i.e. onefor templatetags and filters, one for unofficial patches/modifications to the core Django codebase, etc).-- The probability of failure of a (computer) system is exponentially proportional to the physical distance between it and the one who could fix it. -- Martin F. Krafft --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Django book...2...Apress
Hello I sent some mail around to Apress, PrenticeHall and bla bla, to know something about Django books. I got only one answer until know that I want to share: --- Hi Daniele, Apress will publish "Pro Django: Web Development Done Right" | 1590597257 | in Oct. 2006. Check out the book here: http://www.apress.com/book/bookDisplay.html?bID=10176. Thanks, Janet - Hope It's useful. Picio --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django under IIS with ISAPI
I was never able to get PyISAPIe to work myself. I ended up buying the isapi_rewrite product from helicon (http://www.isapirewrite.com/) and just proxying to Apache on :9080. I really wanted PyISAPIe to work, but isapi_rewrite was fairly cheap and easy to install. It feels like overkill - but I haven't had any problems so far --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Italian Documentation
Hello. sorry for the double question. About the suggestion on 1.0 I've already started learning 0.95. Thanks. About the documentation: 1. I considered from the beginning only the official release 0.95 tutorial. 2. In the page you mentioned I saw that tutorial part 1 italian is already finished by you so mine would be a "surplus". From now on I will check the page before any translation start. 3. The reason why I decided to translate the official tutorial is just to help myself into learning Django. I don't pretend to be so good in translation so a supervision would be necessary. (And also I don't know well the Rest formatting). But I definitely offer my help in translate docs. 4 I wold go ahead and do tutorial part 2,3,4 are you aready there? Picio P.S: I'm from Rome and 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 -~--~~~~--~~--~--~---
Re: How about a Django apps public repository?
Hey Djangoers, check out www.devjavu.com looks cool PS: www.tracOS.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Backwards relation (ie XXX_set) across apps
On 9/9/06, Steven Armstrong <[EMAIL PROTECTED]> wrote: > > I had a similar problem recently. It turned out to have something to do > with the blank=True and null=True arguments. > > picture = models.ForeignKey(Photo, blank=True,null=True) > > Maybe, for testing, try removing those and see it the article_set is > available as expected without them. > > picture = models.ForeignKey(Photo) > > If it is, it may be a bug in django. > > I don't know if this is really related to your problem, just thought > I'll drop a note here as the symptoms sound familiar. No such luck, I'm still seeing the problem. I appreciate the thought though! Jay P. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Backwards relation (ie XXX_set) across apps
I wonder if this is somehow related. From the db_api documentation, in the "How are the backward relationships possible?" section, it states: "The answer lies in the INSTALLED_APPS setting. The first time any model is loaded, Django iterates over every model in INSTALLED_APPS and creates the backward relationships in memory as needed. Essentially, one of the functions of INSTALLED_APPS is to tell Django the entire model domain." Because 'stockphoto' appears before 'articles' in INSTALLED_APPS, could it be preventing the ORM from seeing the 'Article' model? That doesn't feel quite right, simply because someone would have hit it before this, but it's a possibility. Jay P. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Django under IIS with ISAPI
Has anyone actually got an app working with the PyISAPIe extensions? The wiki gets as far as a Django error message, and we've reproduced this on two machines (IIS 5.1 and 6.0) in the last 2 days. The fundamentals clearly work, but the problem is that the default pointy-clicky way of calling external handlers in IIS is based on file extensions, and Django URLs don't end in .py or .cgi. The graphical IIS dialog will not actually permit you to associate '*' (i.e. all URLs under a virtual directory, or the root) with pyisapie.dll; you have to type a dot and an extension. A colleague of mine has found a working approach for moinmoin here; this uses the ISAPI hooks which have been in Pythonwin for years, and a command-line script which registers the python code to handle all extensions under a number of directories. It also has some neat-looking code to watch for and reload any changed Python modules. http://moinmoin.wikiwikiweb.de/MoinMoin_ISAPI If anyone here already has Django running under IIS, please tell me - otherwise we'll have a crack at this and update the wiki if it works. - Andy Robinson, ReportLab --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Backwards relation (ie XXX_set) across apps
On 09/08/06 16:33, Jay Parlar wrote: > On 9/8/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: >> I just tried the following in a test project; >> >> testproject/mytest/models.py: >> from django.db import models >> >> class Image(models.Model): >> name = models.CharField(maxlength=20) >> testproject/mytest2/models.py--- >> from django.db import models >> from testproject.mytest.models import Image >> >> class Article(models.Model): >> name = models.CharField (maxlength=20) >> img = models.ForeignKey(Image) >> >> --- >> >> Then, add both apps to INSTALLED_APPS, sync, and in a shell: >> >> >from testproject.mytest.models import Image >> >from testproject.mytest2.models import Article >> >> >img1 = Image(name='foo') >> >img1.save() >> >> >art1 = Article(name='bar', img=img1) >> >art1.save() >> >> >img1 = Image.objects.all()[0] >> >print img1.article_set.all() >> >> returns [] as expected. Do you get the same result >> if you use this project? >> >> Can you provide any more details about you application? >> >> The only reason I can think that you wouldn't get a _set descriptor is in >> the case of a m2m relation to self. > > Well, from the shell, it seems to work like a charm. It only seems to > broken at the Admin level. > > My Photo model is here: > http://svn.jayparlar.com/website/trunk/awwca/stockphoto/models.py > (This is almost identical to the models.py that ships with the > 'stockphoto' application) > > My Article model is here: > http://svn.jayparlar.com/website/trunk/awwca/articles/models.py > (Although for these tests today, I stripped out all the fields except > 'title' and 'picture') > > Here's what I tried: Added a Photo and Article from the admin. In the > shell, there was no 'article_set' attribute. > > However, staying in the shell, I created (and saved) a *new* Article > instance, giving it the Picture instance that was created in the > Admin. After that, I *would* have an 'article_set' attribute, that > would show both the Article created in the Admin, and the one created > in the shell. > Hi Jay I had a similar problem recently. It turned out to have something to do with the blank=True and null=True arguments. picture = models.ForeignKey(Photo, blank=True,null=True) Maybe, for testing, try removing those and see it the article_set is available as expected without them. picture = models.ForeignKey(Photo) If it is, it may be a bug in django. I don't know if this is really related to your problem, just thought I'll drop a note here as the symptoms sound familiar. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: How about a Django apps public repository?
>From exploring Google Code a short bit, I'm not positive it's the best medium, at least if we want any decent discussion or Web-based documentation. Yes, one could hold discussions via the Issues, but that's pretty gimpy for any discussion that does not fit well as a trouble ticket. And one could just have "local" documentation in as files included with the source code, but that's also not ideal, IMO. I guess in my mind a Djangoforge would be a collection of Trac instances (see e.g. code.djangoproject.com), where each project has a wiki for discussion and documentation, source code management, etc. That would work best for a collection of full apps. It works less well for smaller, more atomic items like templatetags, although I suppose one would just collect those into a handful of other Tracs (i.e. one for templatetags and filters, one for unofficial patches/modifications to the core Django codebase, etc). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: How about a Django apps public repository?
On Sep 8, 2006, at 7:22 AM, Sean Schertell wrote: > > Very interesting points. Does anyone have any thoughts on using > Google code hosting for this idea? Anyone know off the top of their > heads whether or not we'd be able to create a Django "category" > within Google or would it just sort of be lumped in with all the > other Python stuff? There are already users hosting Django code on Google: http://code.google.com/hosting/search?q=label:django This link is already posted on the django website: http://code.djangoproject.com/ Don --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: How do you get and set cookies in django
On 9/8/06, mthorley <[EMAIL PROTECTED]> wrote: > This may be a really dumb one, but I'm stooped. I read about > request.COOKIES, and request.session.set_test_cookie() and > request.session, but as far as I can see, they are not what I want. > > I want to save a named cookie, with a value, and specific domain and > path. Like PHP's setcookie(). I'm sure I'm just missing the obvious. Hey Matthew, Other people have pointed out the session framework, but if you just want to set arbitrary cookies you can use request.set_cookie(), documented here: http://www.djangoproject.com/documentation/request_response/#id1 Adrian -- Adrian Holovaty holovaty.com | djangoproject.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: How do you get and set cookies in django
Thanks limodou, that's just what I was looking for! -- mthorley --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Backwards relation (ie XXX_set) across apps
On 9/8/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > I just tried the following in a test project; > > testproject/mytest/models.py: > from django.db import models > > class Image(models.Model): > name = models.CharField(maxlength=20) > testproject/mytest2/models.py--- > from django.db import models > from testproject.mytest.models import Image > > class Article(models.Model): > name = models.CharField (maxlength=20) > img = models.ForeignKey(Image) > > --- > > Then, add both apps to INSTALLED_APPS, sync, and in a shell: > > >from testproject.mytest.models import Image > >from testproject.mytest2.models import Article > > >img1 = Image(name='foo') > >img1.save() > > >art1 = Article(name='bar', img=img1) > >art1.save() > > >img1 = Image.objects.all()[0] > >print img1.article_set.all() > > returns [] as expected. Do you get the same result > if you use this project? > > Can you provide any more details about you application? > > The only reason I can think that you wouldn't get a _set descriptor is in > the case of a m2m relation to self. Well, from the shell, it seems to work like a charm. It only seems to broken at the Admin level. My Photo model is here: http://svn.jayparlar.com/website/trunk/awwca/stockphoto/models.py (This is almost identical to the models.py that ships with the 'stockphoto' application) My Article model is here: http://svn.jayparlar.com/website/trunk/awwca/articles/models.py (Although for these tests today, I stripped out all the fields except 'title' and 'picture') Here's what I tried: Added a Photo and Article from the admin. In the shell, there was no 'article_set' attribute. However, staying in the shell, I created (and saved) a *new* Article instance, giving it the Picture instance that was created in the Admin. After that, I *would* have an 'article_set' attribute, that would show both the Article created in the Admin, and the one created in the shell. Jay P. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: How do you get and set cookies in django
On 9/8/06, mthorley <[EMAIL PROTECTED]> wrote: > > This may be a really dumb one, but I'm stooped. I read about > request.COOKIES, and request.session.set_test_cookie() and > request.session, but as far as I can see, they are not what I want. > > I want to save a named cookie, with a value, and specific domain and > path. Like PHP's setcookie(). I'm sure I'm just missing the obvious. > Here is the source code from dango session dealing, maybe helpful: expires = datetime.datetime.strftime(datetime.datetime.utcnow() + datetime.timedelta(seconds=settings.SESSION_COOKIE_AGE), "%a, %d-%b-%Y %H:%M:%S GMT") response.set_cookie(settings.SESSION_COOKIE_NAME, session_key, max_age=settings.SESSION_COOKIE_AGE, expires=expires, domain=settings.SESSION_COOKIE_DOMAIN) some parameters you can replace with your values. -- I like python! My Blog: http://www.donews.net/limodou UliPad Site: http://wiki.woodpecker.org.cn/moin/UliPad UliPad Maillist: http://groups.google.com/group/ulipad --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Problem querying M2M relationships
> Ok; I just re-ran the tests with SQLite, and I am getting the same problem. > > Poking through the bug database, it looks like you are hitting Bug #2091. > I've updated that ticket with the details of your problem, and what I've > been able to work out so far. Mmm... I'm used to look in the doc, I'll have to learn to look the bug database :-) Thanks a lot, Guille --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: How about a Django apps public repository?
Very interesting points. Does anyone have any thoughts on using Google code hosting for this idea? Anyone know off the top of their heads whether or not we'd be able to create a Django "category" within Google or would it just sort of be lumped in with all the other Python stuff? Sean On Sep 8, 2006, at 9:59 PM, Jeff Forcier wrote: > > I'd like to note that this is not the first time this has come up, > although I don't wish to imply we should not be discussing it (it > seems > to be one of those issues that comes up periodically). > > > http://groups.google.com/group/django-users/browse_frm/thread/ > 5e5a61a14c2e519a > > There was also a discussion on IRC from even farther back: > > http://simon.bofh.ms/logger/django/2005/11/18/09/17 > > I actually wrote up some random thoughts about this issue on a > personal > wiki page, and I figure I might as well throw those out now. Apologies > for the length and the formatting (it's obviously in wiki source > format). > > > re: "Djangoforge" > > [The links I shared above were also pasted here at the top of the > page] > >> From that discussion plus a handful of others, it looks like an > official one ''is'' planned for the 1.0 release? > > * Should it be official or unofficial? > ** If it's official, that would be "nicer" because there would be a > mandate for it, it would be in a central location along with > everything > else, etc. > ** However, if official, we might run into the problem of people > expecting official support for the non-core-dev-written code contained > therein. This is probably the #1 reason to make it unofficial--or not > to have it at all, since even an unofficial one would really need > to be > linked from the official site, and thus gain officiality by > association. > *** So then the question becomes, is its usefulness going to outweigh > that support concern? > ** Also, I found a reference on the IRC channel from 2005.10.03 > quoting > one of the core devs as saying such a thing would be a "conflict of > interest" but that they'd be happy to have someone else host it. If > still true, this would make this official/unofficial issue moot (and > the wiki-related items below would have to pertain to some non-Django > wiki). > * What should it contain? Most of these are possibilities, I'm not > necessarily saying I think they should all be included. > ** Anything that does not belong in the core "contrib" directory, > stuff > that is not in the official trunk code. I.e. when someone says "Why is > Common/Useful Feature X not in Django?" and the core devs do not want > to include that feature in the short/long term, someone could make one > (app/templatetag/patch) and stick it on the Djangoforge. > ** Common model examples and/or fleshed-out explanations of the ones > already included in the docs. For example, how to do tags correctly > (and/or a small discussion of the different approaches to that problem > and their pluses/minuses). > ** Common templatetags, such as ones for len(), 'if x in y', etc. > ** Full applications, probably the primary reason people mention this > sort of project. Blog, photo gallery, wiki, etc. > * What format should it be in? > ** Is there a good reason NOT to have it in the code.djangoproject > wiki? I'd say that depends on exactly what is provided (see previous > point re: what should it contain?). For simple stuff like code > snippets > (templatetags, model layouts) we already have many on the wiki. Full > apps/projects would be something else--yes, you can attach archives to > wiki pages, but we probably want source control for this stuff, right? > *** Furthermore, the wiki provides, well, a wiki--built-in discussion > and unlimited expandability by the users. At least some of a wiki's > functionality is really required for this sort of thing, IMO. > ** Should we use whatever OSS "Forge" systems already exist? I have > not > examined them closely, but my gut instinct from using them to some > degree is that they're kinda "loud" UI-wise, plus they aren't as > collaborative as we might need (which brings us back to the wiki). > However, if good ones exist, they have theoretically solved all these > problems before and we might not want to reinvent the wheel. > ** Roll something new (with Django, of course)? See previous point re: > reinventing the wheel; but a roll-our-own could, of course, provide > exactly the features we need in the way we need them (note to newbies, > this duality of thinking is why the open source community is so damned > fragmented ;)). > > > > Regards, > Jeff > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~-
Re: How do you get and set cookies in django
This page should help. http://www.djangoproject.com/documentation/sessions/ --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
How do you get and set cookies in django
This may be a really dumb one, but I'm stooped. I read about request.COOKIES, and request.session.set_test_cookie() and request.session, but as far as I can see, they are not what I want. I want to save a named cookie, with a value, and specific domain and path. Like PHP's setcookie(). I'm sure I'm just missing the obvious. Any hints? Thanks -- matthew --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Problem querying M2M relationships
On 9/8/06, Guillermo Fernandez Castellanos < [EMAIL PROTECTED]> wrote: Hi,> This seems to be correct. Perhaps it is a DB specific problem - what > database are you using (my tests were with postgres)?I am using sqlite3, with the latest django cvs tree.Ok; I just re-ran the tests with SQLite, and I am getting the same problem. Poking through the bug database, it looks like you are hitting Bug #2091. I've updated that ticket with the details of your problem, and what I've been able to work out so far. Yours,Russ Magee %-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: How about a Django apps public repository?
I'd like to note that this is not the first time this has come up, although I don't wish to imply we should not be discussing it (it seems to be one of those issues that comes up periodically). http://groups.google.com/group/django-users/browse_frm/thread/5e5a61a14c2e519a There was also a discussion on IRC from even farther back: http://simon.bofh.ms/logger/django/2005/11/18/09/17 I actually wrote up some random thoughts about this issue on a personal wiki page, and I figure I might as well throw those out now. Apologies for the length and the formatting (it's obviously in wiki source format). re: "Djangoforge" [The links I shared above were also pasted here at the top of the page] >From that discussion plus a handful of others, it looks like an official one ''is'' planned for the 1.0 release? * Should it be official or unofficial? ** If it's official, that would be "nicer" because there would be a mandate for it, it would be in a central location along with everything else, etc. ** However, if official, we might run into the problem of people expecting official support for the non-core-dev-written code contained therein. This is probably the #1 reason to make it unofficial--or not to have it at all, since even an unofficial one would really need to be linked from the official site, and thus gain officiality by association. *** So then the question becomes, is its usefulness going to outweigh that support concern? ** Also, I found a reference on the IRC channel from 2005.10.03 quoting one of the core devs as saying such a thing would be a "conflict of interest" but that they'd be happy to have someone else host it. If still true, this would make this official/unofficial issue moot (and the wiki-related items below would have to pertain to some non-Django wiki). * What should it contain? Most of these are possibilities, I'm not necessarily saying I think they should all be included. ** Anything that does not belong in the core "contrib" directory, stuff that is not in the official trunk code. I.e. when someone says "Why is Common/Useful Feature X not in Django?" and the core devs do not want to include that feature in the short/long term, someone could make one (app/templatetag/patch) and stick it on the Djangoforge. ** Common model examples and/or fleshed-out explanations of the ones already included in the docs. For example, how to do tags correctly (and/or a small discussion of the different approaches to that problem and their pluses/minuses). ** Common templatetags, such as ones for len(), 'if x in y', etc. ** Full applications, probably the primary reason people mention this sort of project. Blog, photo gallery, wiki, etc. * What format should it be in? ** Is there a good reason NOT to have it in the code.djangoproject wiki? I'd say that depends on exactly what is provided (see previous point re: what should it contain?). For simple stuff like code snippets (templatetags, model layouts) we already have many on the wiki. Full apps/projects would be something else--yes, you can attach archives to wiki pages, but we probably want source control for this stuff, right? *** Furthermore, the wiki provides, well, a wiki--built-in discussion and unlimited expandability by the users. At least some of a wiki's functionality is really required for this sort of thing, IMO. ** Should we use whatever OSS "Forge" systems already exist? I have not examined them closely, but my gut instinct from using them to some degree is that they're kinda "loud" UI-wise, plus they aren't as collaborative as we might need (which brings us back to the wiki). However, if good ones exist, they have theoretically solved all these problems before and we might not want to reinvent the wheel. ** Roll something new (with Django, of course)? See previous point re: reinventing the wheel; but a roll-our-own could, of course, provide exactly the features we need in the way we need them (note to newbies, this duality of thinking is why the open source community is so damned fragmented ;)). Regards, Jeff --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: How about a Django apps public repository?
On 9/8/06, Wade Leftwich <[EMAIL PROTECTED]> wrote: > > Ned Batchelder wrote: > > Why not use the existing Python Cheeseshop > > (http://cheeseshop.python.org/pypi) for this? Advantages: > > > > 1) You don't have to build anything, it's already there. > > 2) More visibility for Django: with a Django-specific repository, only > > Django developers will see the packages. In the cheeseshop, all Python > > developers will see the packages, and could find Django through a > > contributed package, rather than the other way around. > > 3) The energy we'd put into a Django-only repository could instead be > > used to further the cause of the cheeseshop. > > > > --Ned. > > > > Plus: easy_install will find your eggs in the cheeseshop. > (It has no cheese, but lots of eggs.) > > -- Wade > Because pypi is not a real repository, but maybe very similar with what we want the django-repository should be first. I don't know what django-spec repository will be like ultimately, but I think if we setup the repository ourselvs, we can do anything we want, but for pypi, we cannot. And even if we setup our own django-spec repository, we can still submit new version information of django stuffs to pypi, no one would say that's impossible. -- I like python! My Blog: http://www.donews.net/limodou UliPad Site: http://wiki.woodpecker.org.cn/moin/UliPad UliPad Maillist: http://groups.google.com/group/ulipad --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: mod_python - Using Apache prefork Vs Apache worker
Hi there Just to report on this, i set up a machine with very little memory using apache 2.2.1 (worker mpm), with mod_python 3.3 (development version 20060520) and django. It seems there is nothing much in django nor python that isn't thread safe. External C libraries you load as a python module might bring up issues. This installation is for development and never stands a high load. Worker mpm is setup to handle 20 threads in a single process, which causes all requests to be handled through the same resident python interpreter under normal load. Main problem here is that there isn't enough memory to keep both apache worker process and mysql instance resident. This results in swapping and delays, but no timeouts, crashes or coredumps seen. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: How about a Django apps public repository?
Ned Batchelder wrote: > Why not use the existing Python Cheeseshop > (http://cheeseshop.python.org/pypi) for this? Advantages: > > 1) You don't have to build anything, it's already there. > 2) More visibility for Django: with a Django-specific repository, only > Django developers will see the packages. In the cheeseshop, all Python > developers will see the packages, and could find Django through a > contributed package, rather than the other way around. > 3) The energy we'd put into a Django-only repository could instead be > used to further the cause of the cheeseshop. > > --Ned. > Plus: easy_install will find your eggs in the cheeseshop. (It has no cheese, but lots of eggs.) -- Wade --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: How about a Django apps public repository?
Why not use the existing Python Cheeseshop (http://cheeseshop.python.org/pypi) for this? Advantages: 1) You don't have to build anything, it's already there. 2) More visibility for Django: with a Django-specific repository, only Django developers will see the packages. In the cheeseshop, all Python developers will see the packages, and could find Django through a contributed package, rather than the other way around. 3) The energy we'd put into a Django-only repository could instead be used to further the cause of the cheeseshop. --Ned. Sean Schertell wrote: > I wonder how many of us are writing nearly identical apps at any > given time. For example, I just hired a guy to write a really basic > newsletter app for my project. Now I'm working on a fairly typical > "upcoming events" schedule. And soon I'll be working on a simple > photo gallery that makes thumbnails as you upload, etc. I'd bet > dollars to donuts that many of you have written these apps already. > > Wouldn't Django be that much sexier if it came with an ever-expanding > repository of apps that we could all share with each other? The fact > that apps are modular plug-and-play in Django is *really* cool (Rails > can't do that). So why not leverage the "pluggability" of Django's > app architecture by making a bunch of these apps public? > > Am I alone on this? If I created such a repository would anyone use it? > > Sean > > > > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Creating graphs in Django application
On 9/7/06, Devraj <[EMAIL PROTECTED]> wrote: > > Hi everyone, > > I am attempting to create graphs in my Django app.to provide reporting > features. Are there any libraries available to do this in Python or > Django? haven't used it, but there's also Ploticus: - http://ploticus.sourceforge.net/ - python API http://www.srcc.lsu.edu/~davids/ploticus_module.html -- Derek --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Problem querying M2M relationships
Hi, > This seems to be correct. Perhaps it is a DB specific problem - what > database are you using (my tests were with postgres)? I am using sqlite3, with the latest django cvs tree. > Also; after you have executed these queries, the following: > from django.db import connection > print connection.queries > will dump the exact SQL that was executed. This might be helpful in > diagnosing the problem. I'll do it and go back to you. Thanks! G --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Problem querying M2M relationships
On 9/6/06, Guillermo Fernandez Castellanos <[EMAIL PROTECTED] > wrote:I've checked the docs, but nothing seems to be wrong to me.Any help appreciated, thanks. I just tried the following using your models (plus a __str__ definition): p1 = Person(name='russ')p1.save()p2 = Person(name='guillermo')p2.save() p3 = Person(name='guido')p3.save()c1 = Class(name='Music')c1.save()c2 = Class(name='Art')c2.save()p1.classes = [c1, c2]p2.classes = [c1]p3.classes = [c2]>>>print Person.objects.filter(classes__id__exact=2)[, ] >>>print Person.objects.filter(classes__name__startswith='Music')[, guillermo>]>>>print Person.objects.filter(classes__name__exact='Music') [, guillermo>] >>> print Person.objects.filter(classes__name__startswith='Mus') [, guillermo>] >>> print Person.objects.filter(classes__name__exact='Mus') [] This seems to be correct. Perhaps it is a DB specific problem - what database are you using (my tests were with postgres)?Also; after you have executed these queries, the following:from django.db import connection print connection.querieswill dump the exact SQL that was executed. This might be helpful in diagnosing the problem.Yours,Russ Magee %-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Backwards relation (ie XXX_set) across apps
On 9/7/06, Jay Parlar <[EMAIL PROTECTED]> wrote: The only reason I can guess is that because the two models are definedin separate applications. Am I missing something here?I just tried the following in a test project; testproject/mytest/models.py:from django.db import modelsclass Image(models.Model): name = models.CharField(maxlength=20)testproject/mytest2/models.py---from django.db import modelsfrom testproject.mytest.models import Imageclass Article(models.Model): name = models.CharField (maxlength=20) img = models.ForeignKey(Image)---Then, add both apps to INSTALLED_APPS, sync, and in a shell:>from testproject.mytest.models import Image>from testproject.mytest2.models import Article>img1 = Image(name='foo')>img1.save()>art1 = Article(name='bar', img=img1)>art1.save()>img1 = Image.objects.all()[0]>print img1.article_set.all() returns [] as expected. Do you get the same result if you use this project?Can you provide any more details about you application?The only reason I can think that you wouldn't get a _set descriptor is in the case of a m2m relation to self. PS. An interesting (and perhaps related) sidenote: In myINSTALLED_APPS, I *have* to have the 'stockphoto' app appear before the 'articles' app, otherwise I get the following when trying toimport 'Article' in IPython:ImportError: No module named modelThis is an reference resolution problem; Article references Photo, so Photo needs to be defined first. Yours,Russ Magee %-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Diamanda Wiki and MyghtyBoard Forum on SVN now
Trac syntax is rather nice and good for simple things :) All weird things will be available via CBC: [rk:tex]tex code here[/rk:tex] Or simillar, just a *toHTML converter required :) other wikis syntax probably will be available in the same way. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Shared Hosting suggestion
Webfaction == SSH access + local apache configuration means that I run several django-powered web sites from the same virtual host and I can keep Django and other open source products updated frequently with subversion. Highly recommend, technical support is great and they go back a long way with Python awareness (which helps, believe 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 -~--~~~~--~~--~--~---
Re: How about a Django apps public repository?
+1, great idea! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Italian Documentation
> A trivial question: Is it better to wait 1.0 for me to learn django? In my opinion, NO. Why wait for 1.0? If you are learning Django you have two choices: use an official release or stay with the trunk. I'm using the trunk since I'm using Django, and I never had problems. However I must say that each time I do an svn up I always feel the fear that something breaks. But it is just a personal problem, I repeat that I never had any kind of unpleasant situation. If you choose for the trunk be sure to read http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges . Anyway, now I would choose stable releases. It is supposed, for the most of the times, that someone that is learning Django isn't interested in the bleeding edges features, and maybe it's better to have them in the next official release, in all their reliability. Do you want a diff from the current Django release and 1.0? Look here: http://www.djangoproject.com/documentation/api_stability/ Paolo P.S. Please, next time could you please create a dedicated thread when ask different questions? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Italian Documentation
Hi, I'm sorry to see your post so late. This page on the wiki should answer all your questions: http://code.djangoproject.com/wiki/TranslateDocumentation Differently, ask! I can assure that translate live documentation (docs in the trunk I mean) and keep it up to date is a real pain, I did so but it definitively it is not the best approach if you haven't a lot of time at your disposal. You could rather consider to stick on official releases. As documentation for a particular Django release is frozen once the version has been released officially, unless some security update forces a change to some document, I suggest you to keep translated the last stable release (0.95, at the moment) and go for it. (more details here: http://www.djangoproject.com/documentation/documentation/ ) I think that update translations from a release to the next release should be reasonably smooth and easy. Paolo --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---