Re: [patch] Generating slug for words with accents
Maciej Bliziński a écrit : > I'm including a patch with "from" and "to" constants extended with all > the characters I found on Wikipedia that seemed to be of any use. This > should cover all the Slavic countries except those which use cyrylic > alphabet. Was this page commit to svn version of django, as in 0.95 I was facing this issue with french accents. Nicolas --~--~-~--~~~---~--~~ 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: Generating slug for words with accents
Would this make sense to integrate on the server side (instead of JS), say next to django.utils.text.get_valid_filename()? --~--~-~--~~~---~--~~ 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: [patch] Generating slug for words with accents
German ß should be translated to ss ä to ae ö to oe ü to ue Regards, Aidas Bendoraitis [aka Archatas] On 11/16/06, Nicolas Steinmetz <[EMAIL PROTECTED]> wrote: > > Maciej Bliziński a écrit : > > > I'm including a patch with "from" and "to" constants extended with all > > the characters I found on Wikipedia that seemed to be of any use. This > > should cover all the Slavic countries except those which use cyrylic > > alphabet. > > Was this page commit to svn version of django, as in 0.95 I was facing > this issue with french accents. > > Nicolas > > > > > --~--~-~--~~~---~--~~ 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: Automatically adding http:// to a URLField
Thanks - I guess I will have to add the extra validator. Any chance you would know how to write one for this (i.e. how to add the validator to the model, and then pass it back to the default validator once it's done?) canen wrote: > On Nov 15, 2:45 pm, "Julio Nobrega" <[EMAIL PROTECTED]> wrote: > > Override the save method on your model to check if the "http://"; > > string is not in the self.field_name, and if it's not, add it. > > http://www.djangoproject.com/documentation/model_api/#overriding-defa... > > > If it fails validation I don't think it would reach the save method, I > could be wrong. You can always add an extra validator > http://www.djangoproject.com/documentation/model_api/#validator-list > > > On 11/15/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > > > > > Hey, > > > > > Am trying to use a URLField in my app, but if the user doesn't stick > > > http:// on the front of it, it fails vaildation. Is there a way to > > > automatically add one if one isn't present - rather than it just > > > failing validation? > > > > > Many Thanks, > > > Oliver-- > > Julio Nobrega -http://www.inerciasensorial.com.br --~--~-~--~~~---~--~~ 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: Blog engine
There is a few examples if you look in the mailing list: http://code.djangoproject.com/browser/djangoproject.com/django_website/apps/blog http://www.fallingbullets.com/blog/2006/nov/02/falling-bullets-source-code-you-ninnies/ http://www.rossp.org/blog/2006/may/15/django-magic-removal-upgrade/ http://www.guindilla.eu:8000/guindilla/trunk/guindilla/ And many others. Hope it helps, G On 11/16/06, Mikhail Shevchuk <[EMAIL PROTECTED]> wrote: > > Hello friends, > > Could anyone tell me where can I get a blog engine written > in Django framework? > > -- > Generosity and perfection are your everlasting goals. > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Curious error with Free Comments
Hi, I have been trying to integrate Free Comments following the popular article -- http://code.djangoproject.com/wiki/UsingFreeComment I am getting this error. VariableDoesNotExist at /articles/2006/nov/11/shahjahan/ Failed lookup for key [id] in This my code snippet from article_detail.html, which displays the articles properly prior to comment integration. I also have provided the model from models.py. Curiously this works when I change object.id to object.slug. However I am unable to see the comments, while rest of it works fine. {% load comments.comments %} {% get_free_comment_count for content.article object.id as comment_count %} Posted on {{ object.date|date:"F j, Y" }} {{ comment_count }} Comment{{ comment_count|pluralize }}Topics: {% for topic in object.topic_set.all %}{% if not forloop.first %}, {% endif %}{{ topic.title }}{% endfor %} {% get_free_comment_list for content.article object.id as comment_list %} Comments {% for comment in comment_list %} #{{ forloop.counter }} {{ comment.person_name }} commented, on {{ comment.submit_date|date:"F j, Y" }} at {{ comment.submit_date|date:"P" }}: {{ comment.comment|escape|urlizetrunc:40|linebreaks }} {% endfor %} Post a comment {% free_comment_form for content.article object.id %} {% endblock %} Here is my model class Article (models.Model): author = models.ForeignKey(Author) headline = models.CharField (maxlength=100) slug = models.SlugField ('Slug', prepopulate_from =('headline',), primary_key = 'True', help_text= "Shahs, this will be filled automatically from the name of the author") intro = models.CharField (maxlength=320) topic = models.ManyToManyField (Topic) slug = models.SlugField ('Slug', prepopulate_from =('headline',), primary_key = 'True', help_text= "Shahs, this will be filled automatically from the name of the headline") date = models.DateTimeField ('Date') keywords = models.CharField (maxlength=144, blank = True) body = models.TextField ('body') language = models.ManyToManyField (Language, blank = True) image = models.ManyToManyField (Image, blank = True, null = True, default = ' ') attachments = models.ManyToManyField (File, blank=True, null = True) reference = models.ManyToManyField (Reference,blank = True, null=True) def __str__(self): return self.headline def get_absolute_url(self): return "/articles/%s/%s/" % (self.date.strftime("%Y/%b/%d").lower(), self.slug) class Admin: list_display = ("headline", "slug", "date","intro","body") list_per_page = 25 search_fields = ("headline", "date", ) date_hierarchy = 'date' class Meta: ordering = ('-date',) Why I am getting this bug? What have I overlooked? Kindly advise --~--~-~--~~~---~--~~ 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: [patch] Generating slug for words with accents
On 11/16/06, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote: > German ß should be translated to ss > ä to ae > ö to oe > ü to ue but «ü» in Spanish should be just «u» (as in pingüino -> pinguino). -- John Lenton ([EMAIL PROTECTED]) -- Random fortune: The trouble with a lot of self-made men is that they worship their creator. --~--~-~--~~~---~--~~ 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: Curious error with Free Comments
Have you altered the freecomment model? I had the same error (well.. something similar) when I changed it to accept person_url and person_email. If so, it is an error in your view which is causing this. On Nov 16, 12:06 pm, "Ramdas S" <[EMAIL PROTECTED]> wrote: > Hi, > > I have been trying to integrate Free Comments following the popular article > --http://code.djangoproject.com/wiki/UsingFreeComment > > I am getting this error. > > VariableDoesNotExist at /articles/2006/nov/11/shahjahan/ > Failed lookup for key [id] in > > This my code snippet from article_detail.html, which displays the articles > properly prior to comment integration. I also have provided the model from > models.py. > > Curiously this works when I change object.id to object.slug. However I am > unable to see the comments, while rest of it works fine. > > {% load comments.comments %} > {% get_free_comment_count for content.article object.id as comment_count %} > > Posted on {{ object.date|date:"F j, Y" }} > {{ > comment_count }} Comment{{ comment_count|pluralize }}Topics: {% > for topic in object.topic_set.all %}{% if not forloop.first %}, {% endif > %}{{ topic.title }}{% endfor %} > > > {% get_free_comment_list for content.article object.id as comment_list %} > Comments > {% for comment in comment_list %} > > #{{ > forloop.counter }} > {{ comment.person_name }} commented, on {{ > comment.submit_date|date:"F j, Y" }} at {{ > comment.submit_date|date:"P"}}:{{ > comment.comment|escape|urlizetrunc:40|linebreaks }} > {% endfor %} > Post a comment > > {% free_comment_form for content.article object.id %} > > {% endblock %} > > Here is my model > > class Article (models.Model): > author = models.ForeignKey(Author) > headline = models.CharField (maxlength=100) > slug = models.SlugField ('Slug', prepopulate_from =('headline',), > primary_key = 'True', help_text= "Shahs, this will be filled automatically > from the name of the author") > intro = models.CharField (maxlength=320) > topic = models.ManyToManyField (Topic) > slug = models.SlugField ('Slug', prepopulate_from =('headline',), > primary_key = 'True', help_text= "Shahs, this will be filled automatically > from the name of the headline") > date = models.DateTimeField ('Date') > keywords = models.CharField (maxlength=144, blank = True) > body = models.TextField ('body') > language = models.ManyToManyField (Language, blank = True) > image = models.ManyToManyField (Image, blank = True, null = True, > default = ' ') > attachments = models.ManyToManyField (File, blank=True, null = True) > reference = models.ManyToManyField (Reference,blank = True, null=True) > > def __str__(self): > return self.headline > def get_absolute_url(self): > return "/articles/%s/%s/" % (self.date.strftime("%Y/%b/%d").lower(), > self.slug) > class Admin: > list_display = ("headline", "slug", "date","intro","body") > list_per_page = 25 > search_fields = ("headline", "date", ) > date_hierarchy = 'date' > class Meta: > ordering = ('-date',) > > Why I am getting this bug? What have I overlooked? Kindly advise --~--~-~--~~~---~--~~ 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: Blog engine
You can also try to build It yourself following this, It's funny! ;) http://www2.lamptraining.com/screencast/1 Picio 2006/11/16, Guillermo Fernandez Castellanos <[EMAIL PROTECTED]>: > > There is a few examples if you look in the mailing list: > http://code.djangoproject.com/browser/djangoproject.com/django_website/apps/blog > http://www.fallingbullets.com/blog/2006/nov/02/falling-bullets-source-code-you-ninnies/ > http://www.rossp.org/blog/2006/may/15/django-magic-removal-upgrade/ > http://www.guindilla.eu:8000/guindilla/trunk/guindilla/ > And many others. > > Hope it helps, > > G > > On 11/16/06, Mikhail Shevchuk <[EMAIL PROTECTED]> wrote: > > > > Hello friends, > > > > Could anyone tell me where can I get a blog engine written > > in Django framework? > > > > -- > > Generosity and perfection are your everlasting goals. > > > > > > > > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Pagination with Custom Views
Hey, I was just wondering if someone could help me out. I want to paginate some views, but they are not generic. This is one of the views I want to paginate: def category_list(request): categories = Category.objects.order_by('name') return shortcuts.render_to_response("blog/category_list.html", dict(categories = categories)) How would I go about paginating that? Thanks so much in advance, Oliver --~--~-~--~~~---~--~~ 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: have mltiple different models ForeignKey the same model and still conveniently get all the data from all other models?
On Nov 12, 3:52 pm, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: > Container > | > + Thing ImageThing > | > + Thing TextThing > > In code this will look like this: [...] > Then you can add a fancy methods to Thing that will return its typed > counterpart (sorta "polymorphism"): > > class Thing(models.Model): >... >def data(self): > return getattr(self, 'image_thing', None) or \ > getattr(self, 'text_thing', None) or \ > getattr(self, 'another_thing') > >def __str__(self): > return str(self.data()) This is a very neat idea. Two questions arise for me as a Django newbie: - How do I convince django.contrib.admin to edit "*thing" contents inline? - What's the preferred method to implement a tree view for the resulting structure in admin (for example in the sidebar on the right)? Regards, /k --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Cursor Delete Not Committing
I feel like this is a simple question, yet I haven't been able to solve it at 5am :) I'm trying to delete through a cursor like this: from django.db import models, connection, transaction cursor = connection.cursor() cursor.execute( query ) But it appears to not be committing. I suspect this because the change doesn't register, and when I try to do the same delete from the postgres command line, it doesn't complete until I close python (so i figure it is releasing a lock or something). Ok, just solved it actually... I looked in the db wrapping and tried calling connection._commit(). Since its a private attribute, I assume I'm doing something wrong though. Is that the case? Thanks, Steve --~--~-~--~~~---~--~~ 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: Pagination with Custom Views
[EMAIL PROTECTED] wrote: > Hey, > > I was just wondering if someone could help me out. I want to paginate > some views, but they are not generic. This is one of the views I want > to paginate: > > def category_list(request): > categories = Category.objects.order_by('name') > > return shortcuts.render_to_response("blog/category_list.html", > dict(categories = categories)) > > How would I go about paginating that? Like this: from django.core.paginator import ObjectPaginator, InvalidPage def category_list(request): paginator = ObjectPaginator(Category.objects.order_by('name'), 50) try: page = request.GET.get('page', 1) categories = paginator.get_page(page - 1) except InvalidPage: categories = [] return render_to_response('template.html', { 'paginator': paginator, 'page': page, 'categories': categories, }, context_instance=RequestContext(request)) --~--~-~--~~~---~--~~ 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: have mltiple different models ForeignKey the same model and still conveniently get all the data from all other models?
Karsten W. Rohrbach wrote: > > > This is a very neat idea. > Two questions arise for me as a Django newbie: > - How do I convince django.contrib.admin to edit "*thing" contents > inline? > - What's the preferred method to implement a tree view for the > resulting structure in admin (for example in the sidebar on the right)? Both these things are 'too custom' to work seamlessly in the current admin. My bet is that it would be way simpler to implement custom views for them. Though I should admit I'm not very experienced in hacking on admin app. However this thing may become more automatic over time when a standard way of model inheritance will be implemented (it is worked on now). However it may take somewhat long. --~--~-~--~~~---~--~~ 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: Pagination with Custom Views
Specifically: unsupported operand type(s) for -: 'str' an --~--~-~--~~~---~--~~ 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: Pagination with Custom Views
Ivan: Thanks so much for your quick reply. One more question - how would I define the page in the URL... ?page=x throws errors at 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: Pagination with Custom Views
Sorry, I meant: unsupported operand type(s) for -: 'str' and 'int' [EMAIL PROTECTED] wrote: > Specifically: > > unsupported operand type(s) for -: 'str' an --~--~-~--~~~---~--~~ 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: Pagination with Custom Views
[EMAIL PROTECTED] wrote: > Specifically: > > unsupported operand type(s) for -: 'str' an Oh... I've forgot to cast a string to an int :-). The line: int(request.GET.get('page', '1')) In fact you should also check for errors here because user can submit something with "page=blah" and it won't be converted to an integer obviously. I assign 1 to a page in this case. --~--~-~--~~~---~--~~ 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: Pagination with Custom Views
hello, I'm desperately searching for a solution as described here (paginator + costom sql): http://groups.google.com/group/django-users/browse_frm/thread/1aa04d3ab8fc9203/ab1384a82c9d5508#ab1384a82c9d5508 and here: http://groups.google.com/group/django-users/browse_frm/thread/d6690c92c5b7347e/7985a43df0f8b43a#7985a43df0f8b43a ... and I still can't find out, what's wrong. Maybe you are able to answer... thank you in advance! robert --~--~-~--~~~---~--~~ 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: Curious error with Free Comments
No, I neve touched any of those I guess it has to do with the fact that I do not have article.id property. What did I do wrong in models this time around Ramdas --~--~-~--~~~---~--~~ 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: Blog engine
Check out http://www.23excuses.com/2006/Jul/07/23-excuses-release-and-introduction/ too. Eric Lake On Nov 16, 7:49 am, Picio <[EMAIL PROTECTED]> wrote: > You can also try to build It yourself following this, It's funny! ;) > > http://www2.lamptraining.com/screencast/1 > > Picio > > 2006/11/16, Guillermo Fernandez Castellanos > <[EMAIL PROTECTED]>: > > > > > There is a few examples if you look in the mailing list: > >http://code.djangoproject.com/browser/djangoproject.com/django_websit... > >http://www.fallingbullets.com/blog/2006/nov/02/falling-bullets-source... > >http://www.rossp.org/blog/2006/may/15/django-magic-removal-upgrade/ > >http://www.guindilla.eu:8000/guindilla/trunk/guindilla/ > > And many others. > > > Hope it helps, > > > G > > > On 11/16/06, Mikhail Shevchuk <[EMAIL PROTECTED]> wrote: > > > > Hello friends, > > > > Could anyone tell me where can I get a blog engine written > > > in Django framework? > > > > -- > > > Generosity and perfection are your everlasting goals. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Search question
I've got some Organization, where each one has some User. A User can write a Ticket. How can I filter all the Ticket for a single Organization? --~--~-~--~~~---~--~~ 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: ImageField - CustomManipulator - save() - ???
no one a solution? --~--~-~--~~~---~--~~ 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: have mltiple different models ForeignKey the same model and still conveniently get all the data from all other models?
On Nov 16, 2:35 pm, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: > Both these things are 'too custom' to work seamlessly in the current > admin. My bet is that it would be way simpler to implement custom views > for them. Though I should admit I'm not very experienced in hacking on > admin app. > > However this thing may become more automatic over time when a standard > way of model inheritance will be implemented (it is worked on now). > However it may take somewhat long. Thanks for the quick reply. However, configurable containers with configurable collections of content is one of the more prominent use cases for a publishing platform (IMVHO) and I somehow took the "Django is for creating CMSes" phrase too literally, it seems. --~--~-~--~~~---~--~~ 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: Re: Pagination with Custom Views
On 11/16/06, soundseeker <[EMAIL PROTECTED]> wrote: > I'm desperately searching for a solution as described here (paginator + > costom sql): In the example you've posted, the method name is 'by_categories', but you seem to be using 'by_category' to execute it. A method named 'by_categories' will always be called 'by_categories', never 'by_category'. -- "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?hl=en -~--~~~~--~~--~--~---
Re: Search question
I solved in this way but maybe there's a better way to do it: organizs = Organization.objects.filter(organization_name__icontains=data['organization_name']) for n in range(len(organizs)): for m in range(organizs[n].person.count()): for i in range(result.count()): if (organizs[n].person.all()[m].username == result[i].submitter.username): tmp.append(result[i].submitter.username) result = result.filter(submitter__username__in=tmp) Thanks in advance for other suggestions. --~--~-~--~~~---~--~~ 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: Search question
Something like that should do it: org = Organization.objects.get(slug="single-organization") tickets = Ticket.objects.select_related.filter(user__organization_id = org.id) or maybe even tickets = Ticket.objects.select_related.filter(user__organization__slug = "single-organization") Regards, Aidas Bendoraitis [aka Archatas] On 11/16/06, Giorgio Salluzzo <[EMAIL PROTECTED]> wrote: > > I've got some Organization, where each one has some User. A User can > write a Ticket. > > How can I filter all the Ticket for a single Organization? > > > > > --~--~-~--~~~---~--~~ 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: Hiding directories from Django?
Nice! I'd been trying to do this with RewriteRules, which didn't work at all. 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?hl=en -~--~~~~--~~--~--~---
Re: Search question
Giorgio Salluzzo wrote: > I've got some Organization, where each one has some User. A User can > write a Ticket. > > How can I filter all the Ticket for a single Organization? Ticket.objects.filter(user__organization__name='SomeOrg') ('user' and 'organization' should be the names of foreign key fields in Ticket and User respectively) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Issues with null foreign key
In my model, I would like to have an optional foreign key on an object. I have tried marking this foreign key as both blank=True and null=True, and both at the same time. The admin forms still complain about a null not being allowed in this db table. I have dropped my entire db and recreated it, but the issue persists. I imagine I am missing something simple here. How do I allow optional foreign keys? --~--~-~--~~~---~--~~ 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: Curious error with Free Comments
I removed the primary_key field now it is working. Otherwise it works with object.slug instead of object.id in case your model has a primary_key on the slug On 11/16/06, Sir Knight < [EMAIL PROTECTED]> wrote: > > > No, I neve touched any of those > > I guess it has to do with the fact that I do not have article.id > property. > > What did I do wrong in models this time around > > Ramdas > > > > > --~--~-~--~~~---~--~~ 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: have mltiple different models ForeignKey the same model and still conveniently get all the data from all other models?
Karsten W. Rohrbach wrote: > Thanks for the quick reply. However, configurable containers with > configurable collections of content is one of the more prominent use > cases for a publishing platform (IMVHO) and I somehow took the "Django > is for creating CMSes" phrase too literally, it seems. Though I never actually designed publishing systems there is a very general thing that is called 'object-relational impedance mismatch'[1]. It basically says that principles of organization of an object oriented program differ in essence from those of a relational database. Inheritance and unified collection of objects of base and derived classes are very common for OO design but they just don't have their direct counterpart in a relational database. In practice this means that when you try to abstract a database away and just map an object model into it transparently it won't work smooth. Django, by design, doesn't try to hide a database structure from a user. So designing a Django models around pure object oriented concepts is really asking for more work than it should take. [1]: http://en.wikipedia.org/wiki/Object-Relational_Impedance_Mismatch --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Indexes in Tables: thoughts or best practices
What's the django way to define indexes for tables? I was surprised to see that there is no IndexField (I know field in not the 'correct' terminology) or similar for django models. The 'search' operator in the db api seems to limited to a sigle field and requires the developer to define the index himself. It would be great if there was a FullTextIndex object that you could use in your model like this: class Person(models.Model); firstname = CharField() middlename = CharField() lastname = CharField() nameindex = FullText(firstname, middlename, lastname) The you could do something like Person.objects.filter(nameindex__search='will') and it would search a FullText index of the combined fields. Something like that should not be very difficult to put together, and it could easily be expanded to support other kinds of indices. I have a need for it in a project I am working on and already worked out a few (ugly) hacks. I would like to know if any one else is working on something similar, or any other thoughts you may have. I have seen the Merquery stuff, but know little about it. Thanks much -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?hl=en -~--~~~~--~~--~--~---
Documentation or bug?
http://www.djangoproject.com/documentation/model_api/#save-on-top This may affect other admin options ... but Django throws a syntax error when `save_on_top' is set before `fields'. The doc merely says that fields is required -- doesn't seem like the order should matter. --~--~-~--~~~---~--~~ 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 find out the id of the last record in a table?
On Nov 15, 2006, at 9:58 PM, simonbun wrote: > > The problem with getting the last record's id and using it, is that > someone might have inserted yet another record while you're still > working on the previous one. > > For single user scenario's it's ok, or if you're using table level > write locking. Yet afaik, its generally a bad idea. Not sure how it works in MySQL, but in Postgres, getting the last inserted id is unique to the current user's (database) session. So if a user inserts a record into the table, then queries the sequence for that id, the value will always be the same, regardless if other table insertions have been done by other users since the first insertion. So the last inserted id should be thought of as the id inserted by this user, not the maximum id inserted by any user. The easiest way to get the last inserted id is to create an object, save it, then read its id directly. If you need the maximum inserted id, use select max(id) from table. 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?hl=en -~--~~~~--~~--~--~---
Something like Application in ASP for django?
I made a custom installer script that work as in CMS systems like xoops (if detect is not installed then build the databse, fill data and config things). The thing is that the process is fired 3 times when I enter to the site, and look like the Mysql transaction support is not robust. I need to check if the setup is already running and think, ok, go to the session framework and put it in the application (like in ASP/ASP.NET the website have a Sesion for each user and a Application - work exactly like sesion- for each website). But not found it... How do this? Is necesary rely in a file check? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
video in django
Hello everybody, Could anyone help me a little bit with video in django? here goes: i have a site where i publish news items. in some news items i would like to have a video. i receive an URL of this video (it's located somewhere else) and i have to integrate it into news item. my idea is this: i have to make an URLField field in class news (so that i can insert URL through admin interface). i think that's kind of ok to do (if somebody has better idea, please tell me). but then i'm not sure what to do. i need to insert html code into template file for this news items, but not every news item has the video. what to do in those cases? i probably have to do something like "if there is a video, insert html code for it" - but how do i do that in a template? I would really appreciate any suggestions and ideas. i know my english is bad and i'm sorry for that - i hope you understand what i'm asking. i have this ideas, but i'm not sure they're right so i thought i'll ask here. thanks in advance, martin --~--~-~--~~~---~--~~ 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: So I made a forum with Django
On 11/3/06, argh44z <[EMAIL PROTECTED]> wrote: > > Here: http://huzzah.cc/ > > I'm thinking about cleaning up the code and open-sourcing it. Is anyone > interested? I ask this because 3 weeks ago when I started working on > it, I didn't really see much forum software written with Django that > was in much actual usage. There were things like Zyons and Myghty, but > I didn't see many sites using them. Looking forward to see the source ;) -- Sincerely, Vladimir "Farcaller" Pouzanov http://hackndev.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: How to restart Django/FastCGI/Lighttpd?
On 16 Nov 2006, at 02:29, Jay Parlar wrote: > Well, here's the way I do it. On my development machine, I do all my > hacking out of a SVN working directory. When I get everything working > how I want it locally, I do my 'svn commit', then login to my > production server. > > From there, I have an svn checkout. Go there, do my 'svn up'. Then, I > do 'svn export --force ...' to make a pristine copy of the contents of > the svn checkout into the directory that contains my actual running > website. > > I'm sure there are better ways, but that's the way that works for me. That sounds great and I tried setting up an SVN repos on Textdrive and it beat me... following the docs, again, it's the concepts that get me, not the specifics... I'm now in the awful position of hacking a live server to do fixes... and people are using it... And the worst thing is, each time I kill the django-fcgi and lighttp... it never quite boots the first time. I'm assuming that it takes django a while to get up... in order for lighttp to connect with it... I really need to get to where you are now... tom --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: video in django
On 11/16/06, Martin <[EMAIL PROTECTED]> wrote: > not every news item has the video. what to do in those cases? i > probably have to do something like "if there is a video, insert html > code for it" - but how do i do that in a template? Make it a field on the new item class, call it maybe 'video_url', and make it optional (use 'blank=True, null=True'). Then in the template: {% if news_item.video_url %} Click here for video {% endif %} -- "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?hl=en -~--~~~~--~~--~--~---
Re: How to find out the id of the last record in a table?
On 11/16/06, Don Arbow <[EMAIL PROTECTED]> wrote: > > On Nov 15, 2006, at 9:58 PM, simonbun wrote: > > > > The problem with getting the last record's id and using it, is that > > someone might have inserted yet another record while you're still > > working on the previous one. > > > > For single user scenario's it's ok, or if you're using table level > > write locking. Yet afaik, its generally a bad idea. > > > > Not sure how it works in MySQL, but in Postgres, getting the last > inserted id is unique to the current user's (database) session. So if > a user inserts a record into the table, then queries the sequence for > that id, the value will always be the same, regardless if other table > insertions have been done by other users since the first insertion. > So the last inserted id should be thought of as the id inserted by > this user, not the maximum id inserted by any user. Yes, this is the functionality that i'm seeking. The id of the object most recently saved on a per user(connection) basis. In case of MySQL (5.0) the id is unique to connection. Here is the relevant portion frrom the docs "For LAST_INSERT_ID(), the most recently generated ID is maintained in the server on a per-connection basis. It is not changed by another client." Don't know about pre-5.0 versions, but i guess it is the same. > > The easiest way to get the last inserted id is to create an object, > save it, then read its id directly. If you need the maximum inserted > id, use select max(id) from table. To do this you should be using the create method and not the save method since the save does not return the object saved. p = Person.objects.create(first_name="Bruce", last_name="Springsteen") p.id will give you the id of the object saved. (example from the docs ) -- Manu --~--~-~--~~~---~--~~ 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: Something like Application in ASP for django?
Are you looking for something like a global registry? The simplest case would probably be using a global variable in your application module, and import the module when you need to access the global variable? If you need to initialize the global variable when the application first start (before the first request), you can call a startup function in settings.py? I am new to Django, would any expert please comment? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Maintenance
Hi, I am working on my first Django powered website. I am concerned about how to modify apps after the site has gone live. For example, I have created a model that contains a class based on the Django Auth User class. Lets say that I go live and have 10,000 users in the db, then I decide I want to add an attribute to that class. This would require a new column to be added to the table in the db and possibly assign some sort of default value to the existing customers. I know how I could do that manually. Are their any Django tools to make that process easier. Also, more generally, can anyone recommend any links,docs, etc... that discuss maintenance issues? Thanks, Chuck --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
./manage.py dbdump > mydata.sql
Would something like this be a useful thing to add to manage.py? It would be a convenience similar to dbshell in that the database credentials are already in settings.py and you can easily do a database dump of your data. -Rob --~--~-~--~~~---~--~~ 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: Django developers NYC???
Hi Brian, Check out http://code.djangoproject.com/wiki/DevelopersForHire. That might get you somewhere. :) http://www.authenticjobs.com/ might also be of help, as well as http://thinkvitamin.com/jobs/developer. Happy hunting! PS: You wouldn't wanna tell us what newspaper you're talking about, would 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: Django developers NYC???
Take a look at his email address --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
KeyError when using blocktrans
With the latest version of Django from SVN, it appears you can no longer use sub-attributes of a template variable within a blocktrans tag. For instance, the following will give you a KeyError: {% blocktrans %}by {{ item.author }} at{% endblocktrans %} However, the following works just fine: {% blocktrans with item.author as itemAuthor %}by {{ itemAuthor }} at{% endblocktrans %} Bug? By design? Misconfiguration? Stack trace of the error is Traceback (most recent call last): File "c:\python24\lib\site-packages\django\template\__init__.py" in render_node 712. result = node.render(context) File "C:\Python24\lib\site-packages\django\templatetags\i18n.py" in render 73. result = translation.gettext(singular) % context File "c:\python24\lib\site-packages\django\template\context.py" in __getitem__ 40. raise KeyError(key) KeyError at /planet/ 'item.author' --~--~-~--~~~---~--~~ 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: Maintenance
cwurld wrote: > Hi, > > I am working on my first Django powered website. I am concerned about > how to modify apps after the site has gone live. For example, I have > created a model that contains a class based on the Django Auth User > class. Lets say that I go live and have 10,000 users in the db, then I > decide I want to add an attribute to that class. This would require a > new column to be added to the table in the db and possibly assign some > sort of default value to the existing customers. I know how I could do > that manually. Are their any Django tools to make that process easier. > > Also, more generally, can anyone recommend any links,docs, etc... that > discuss maintenance issues? > > Thanks, > Chuck There arent any tools to do migrations yet to my knowledge, but I think that they are being worked on. The best way to do that now is just run the alter table statements yourself. --~--~-~--~~~---~--~~ 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 restart Django/FastCGI/Lighttpd?
On 11/16/06, Tom Smith <[EMAIL PROTECTED]> wrote: > I'm sure there are better ways, but that's the way that works for me. > That sounds great and I tried setting up an SVN repos on Textdrive and it > beat me... following the docs, again, it's the concepts that get me, not the > specifics... > > I'm now in the awful position of hacking a live server to do fixes... and > people are using it... > > And the worst thing is, each time I kill the django-fcgi and lighttp... it > never quite boots the first time. I'm assuming that it takes django a while > to get up... in order for lighttp to connect with it... > > I really need to get to where you are now... Well, here's my suggestion then: Start a new thread here in django-users, asking for some TextDrive specific help. A lot of people on this list use TextDrive (a list member is even the one that created TextDrive's screencast). Maybe you can get some answers that way. For better or worse, I use Dreamhost, so I'm afraid I'm not much more help to you. I'm just worried that no one else is reading this thread right now, which is why no one is jumping in to help you with your TextDrive issue. 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?hl=en -~--~~~~--~~--~--~---
how to tell if django is running from apache or standalone?
Hi all, how can I test from within settings.py if I'm running via mod_python or in standalone way? I need to set a variable, accordingly. TIA sandro *:-) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Threading inside django process
Hi I have some questions regarding threading inside django, to know if I can run a a working thread (a thread running each minute, and perform some tasks with the django objects, could be update a view for example ) inside the running django/python/mod_python process ? Like what we can do inside a java appserv, a real thread leaving inside the jvm, coexisting with the application but is django good at this ? If it is, where this thread should be placed and how it could access django objects ? Thanks for 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: Want to see your favorite branch merged? Here's how you can help!
1. Row level permissions 2. Schema Evolution -- Manu --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Automatic gradient generation
Hi everybody, Since I still don't have a website to post a tutorial on, I thought I'd share an idea I worked on today that automatically generates gradient backgrounds of any color for your django sites! I got the idea from 2 website tutorials based on similar subjects http://www.alistapart.com/articles/supereasyblendys and http://www.jacobian.org/writing/2006/jun/30/improved-text-image-view/ This program is a simple python-based proof of concept, in order for you to use it with your website you'll need to follow the two guides above along with using this (modified) function. The program will run standalone for testing purposes and so you can get a gist of the idea. -- import Image, ImageDraw #note in Django this will be a view to which we'll pass the parameters (maybe as GET parameters?) as well as a request def gradient(height = 100, width = 100, r=0, g=0, b=0, fill=100, orientation="fadedown"): #convert our fill to a percentage fill = float(fill)/100 #the image MUST be RGBA for the transparency to work img = Image.new("RGBA", (width, height), color=(r, g, b, 255)) draw = ImageDraw.Draw(img) #begin with no tranparencty a = 255 if orientation == "fadedown" or orientation == "fadeup": amount = height if orientation == "fadeleft" or orientation == "faderight": amount = width for i in range(amount): a -= (255/(amount*fill)) if (orientation == "fadedown"): draw.line((0,i,width,i), fill=(r, g, b, int(a))) elif (orientation == "fadeup"): draw.line((0,height-i,width,height-i), fill=(r, g, b, int(a))) elif (orientation == "faderight"): draw.line((i,0,i,height), fill=(r, g, b, int(a))) elif (orientation == "fadeleft"): draw.line((width-i,0,width-i,height), fill=(r, g, b, int(a))) #for the example, save the image to our hardrive img.save("img.png", "PNG") if __name__ == "__main__": #simple example gradient(height = 400, width = 100, r = 40, g = 40, b = 40, fill = 100, orientation = "fadedown") -- Note that "amount" refers to the percentage fill-color of the gradient you are generating. You may have to try it to completely understand what I mean. The cool thing is, this allows you to make images of any size you want! so you can skip the portions of: http://www.alistapart.com/articles/supereasyblendys in which we are forced to used a resized image as a background and instead use the css background property. Just as in: http://www.jacobian.org/writing/2006/jun/30/improved-text-image-view/ we use response = HTTPResponse(mimetype="image/png") im.save(response, "PNG") response["e-tag"] = etag return response so no messy temp images! Hope you enjoy. -Aaron --~--~-~--~~~---~--~~ 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: Something like Application in ASP for django?
Yes, that is the idea. I test it, and not work. When the request finalize, the module dissapear from memory then the global variables. My hacking way was using a file-lock (create a file, check if exist in the other threads) but maybe exist other 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?hl=en -~--~~~~--~~--~--~---
Django Intern/Contract Work for WPNI
Hi, all. We're looking to hire one or more developers to work on Django apps for the product development group at Washington Post.Newsweek Interactive. We've got a ton of work to get done in the next several months and need help from some skilled coders. Python knowledge is a must, and familiarity with Django is preferred. The position is more of a paid intern or contract position, so the ideal candidate would be a student who wanted to take a few months of for some real world work experience. You would need to be in the DC area while working for us, too. If you'd like more info, please contact me directly -- deryck (at) samba (dot) org. I realize the situation may not suit many here, so if you know someone who might have the skills and be interested, feel free to pass along my note. Cheers, deryck -- Deryck Hodge http://www.devurandom.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?hl=en -~--~~~~--~~--~--~---
Re: Generating slug for words with accents
Spanish info: á é í ó úshould be a e i o u ü should be u ñ should be n I think that's everything in spanish ;) --~--~-~--~~~---~--~~ 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 tell if django is running from apache or standalone?
sandro.dentella wrote: > Hi all, > > how can I test from within settings.py if I'm running via mod_python > or in standalone way? I need to set a variable, accordingly. You could import os and look in os.environ for differences. Maybe somthing differs. -- Christian Joergensen | Linux, programming or web consultancy http://www.razor.dk | Visit us at: http://www.gmta.info --~--~-~--~~~---~--~~ 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 tell if django is running from apache or standalone?
sandro.dentella wrote: > Hi all, > > how can I test from within settings.py if I'm running via mod_python > or in standalone way? I need to set a variable, accordingly. > what do you mean by "standalone"? using the development server? btw. wouldn't the DEBUG variable help you? simply set it to False on the live system (i assume the mod_python one), and to True on the devel system... gabor --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: how to tell if django is running from apache or standalone?
sandro.dentella wrote: > Hi all, > > how can I test from within settings.py if I'm running via mod_python > or in standalone way? I need to set a variable, accordingly. You could use something like: in_mod_python = False try: from mod_python import apache in_mod_python = True except: pass Graham --~--~-~--~~~---~--~~ 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: ./manage.py dbdump > mydata.sql
On 11/17/06, Rob Hudson <[EMAIL PROTECTED]> wrote: > > > Would something like this be a useful thing to add to manage.py? > > It would be a convenience similar to dbshell in that the database > credentials are already in settings.py and you can easily do a database > dump of your data. I've got a prototype of just such a thing as part of the test fixtures framework I am working on. It will dump the current contents of the database in a db-independent format (using the serialization framework). You can then use this dump as a fixture for later tests, or use install the dump as part of a 'reinstall' of a database. I'm still working on some bugs, but I hope to have something to show for my efforts fairly soon. 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?hl=en -~--~~~~--~~--~--~---
Re: Maintenance
On 11/17/06, cwurld <[EMAIL PROTECTED]> wrote: > Are their any Django tools to make that process easier. Nothing specific in the main trunk; however, the schema evolution branch is intended to address this problem. I believe this branch is feature complete, but requires testing before it will join the main trunk. If you want to help out, check out the branch and give feedback. 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?hl=en -~--~~~~--~~--~--~---
apache2 mod-fcgid with django?
According to the django document, you have to setup a FastCgiExternalServer directive in apache conf, But I found there seems no 'FastCgiExternalServer' directive in mod-fcgid, anyone tried mod-fcgid with django? I have succeed deploy it using the shared-hosting provider method from document, just wanna know if setting up a mod-fcgid server is possible or not. --~--~-~--~~~---~--~~ 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: Maintenance
On 17-Nov-06, at 12:59 AM, cwurld wrote: > I am working on my first Django powered website. I am concerned about > how to modify apps after the site has gone live. For example, I have > created a model that contains a class based on the Django Auth User > class. Lets say that I go live and have 10,000 users in the db, then I > decide I want to add an attribute to that class. This would require a > new column to be added to the table in the db and possibly assign some > sort of default value to the existing customers. I know how I could do > that manually you have to do it manually -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ --~--~-~--~~~---~--~~ 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: Automatic gradient generation
On 17-Nov-06, at 3:57 AM, Aaron Torres wrote: > Since I still don't have a website to post a tutorial on, you could post it on the django wiki itself - that is what it is for -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Tutorial
Hello Has anyone got a Django step by step Apache configuration tutorial, I am struggling a bit here Thanks Beagle --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Inside look at Ellington?
Hi there, I know what Ellington is, but the publicity it's got is rather small. Have any of you seen other screenshots of it than the one on their start page? Is the system simply an ordinary project built in Django, or is this another branch? Does *anyone* have any info on Ellington? I just find it rather interesting, yet I can't manage to feed my curiosity. :-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?hl=en -~--~~~~--~~--~--~---
Re: Inside look at Ellington?
On 11/16/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I know what Ellington is, but the publicity it's got is rather small. > Have any of you seen other screenshots of it than the one on their > start page? > > Is the system simply an ordinary project built in Django, or is this > another branch? Does *anyone* have any info on Ellington? I just find > it rather interesting, yet I can't manage to feed my curiosity. :-P Hi henriklied, The Web site is at ellingtoncms.com, and that's got contact information for the people who sell Ellington and can give you more information. This really isn't the best place to ask Ellington questions, as it's a specific Django application rather than a generic piece of Django. 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?hl=en -~--~~~~--~~--~--~---
Re: Inside look at Ellington?
On 11/16/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I know what Ellington is, but the publicity it's got is rather small. > Have any of you seen other screenshots of it than the one on their > start page? Yep. I've even seen all the source code :) Screenshots probably wouldn't be all that exciting, though, because they'd just look like the Django admin interface -- that's what they are, really (we eat our own dogfood). > Is the system simply an ordinary project built in Django, or is this > another branch? Does *anyone* have any info on Ellington? I just find > it rather interesting, yet I can't manage to feed my curiosity. :-P Django was "extracted" from Ellington; the tools which eventually became the Django framework were developed over time to speed the development of the CMS which is now sold as Ellington. And now that there is the distinction between the two, Ellington is Django-powered -- it's a lot of cool Django applications that work together in useful ways. -- "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?hl=en -~--~~~~--~~--~--~---
Re: Re: Inside look at Ellington?
On 11/17/06, James Bennett <[EMAIL PROTECTED]> wrote: > Yep. I've even seen all the source code :) Ah, crap. Meant to reply to him directly, instead of to the list. My apologies for the spam :( -- "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?hl=en -~--~~~~--~~--~--~---
Acces to model object inside model
It is possible to access, and do a query inside models.py ? Something like this: class Tag(models.Model): #props... def _get_count(self): return Tag.objects.all().count() counter = property(_get_count) Do you know what I mean ? --~--~-~--~~~---~--~~ 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: Generating slug for words with accents
Polish: ą = a ć = c ź or ż = z ę = e ó = o ł = l ś = s ń = n 2006/11/17, zenx <[EMAIL PROTECTED]>: > > Spanish info: > á é í ó úshould be a e i o u > ü should be u > ñ should be n > > I think that's everything in spanish ;) > > > > > --~--~-~--~~~---~--~~ 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: Want to see your favorite branch merged? Here's how you can help!
1. Schema Evolution 2. TextIndexingAbstractionLayer En/na Manu J ha escrit: > 1. Row level permissions > 2. Schema Evolution > > -- > Manu > > > > -- Ramon Salvadó [EMAIL PROTECTED] gnuine http://www.gnuine.com Tel: +34.93.567.94.94 Fax: +34.93.567.94.95 GPG Key ID: 0x6EF9C883 --~--~-~--~~~---~--~~ 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: Maintenance
Kenneth Gonsalves wrote: > you have to do it manually yes, as far I understand this is easiest and recommended way. Who knows what business logic rules come with update? I think there will be many non-trivial cases which automatic update will not support. So I agree with Kenneth - basic understanding of SQL is required to do updates. When it comes to a simple schema migration (adding or removing fields) it takes seconds to do it manually via ./manage.py sql APPName and then ./manage.py dbshell where I usually copy/paste the field has been added this way: alter table "tbl_name" add column ; ... replaced with Copy/Paste from what I see in SQL schema above. Typically this is my preferred way to upgrade. --~--~-~--~~~---~--~~ 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: ./manage.py dbdump > mydata.sql
yes would be very useful tool. I have some experience with MySQL, so import/export data between servers running MySQL is not a problem for me. but really, for postgres this process is more complicated, so such "helper" function will be very useful --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---