Re: Django 1.0.2 Thread safety

2009-06-29 Thread Thomas Guettler
Hi, I hit this bug some time ago, too. If you run SVN 1.0.X you get the bug fixes for free. Thomas Miles schrieb: > There should be a little warning in the 1.0.2 docs or on > http://code.djangoproject.com/wiki/DjangoSpecifications/Core/Threading > that it is *not* thread safe. > > I've hit h

sorting different in postgres than in sqlite

2009-06-29 Thread J
Hello, I developed an app for an online contest. In this app, I requested a queryset with totals from a related table, and wanted to display the top ten participants. So, I sorted the queryset on the totals field, descending. Some participants didn't have any items, so the total for these was "No

Re: Global objects

2009-06-29 Thread Alex Gaynor
On Tue, Jun 30, 2009 at 12:14 AM, diogobaeder wrote: > > Oops... sorry... silly error... :-P > > Now, I'm passing the RequestContext instance correctly, but I get a > different error: > http://dpaste.com/61430/ > > Is it because I'm passing None as the second argument for > render_to_response? I

Re: Global objects

2009-06-29 Thread diogobaeder
Oops... sorry... silly error... :-P Now, I'm passing the RequestContext instance correctly, but I get a different error: http://dpaste.com/61430/ Is it because I'm passing None as the second argument for render_to_response? I have no data here, besides the context processor data... Thanks again

Re: serving a static file via nginx requiring authentication from django

2009-06-29 Thread John Hensley
On 6/28/09 10:20 PM, Annie wrote: > I'm trying to this to work: users can download their files from their > account page from a url like this: > http://example.com/account/download/a1234565789asedga-2/ > for which django processes the authentication and then passes along > the info to nginx to se

Re: Global objects

2009-06-29 Thread Alex Gaynor
On Mon, Jun 29, 2009 at 10:43 PM, diogobaeder wrote: > > Alex, > > I'm trying to use the context processors, but I'm getting the > following error: > http://dpaste.com/61410/ > > Any idea of what it might be? > > Thanks! > > Diogo > > > > On Jun 26, 11:56 am, diogobaeder wrote: > > Thanks, Alex,

Re: Global objects

2009-06-29 Thread diogobaeder
Alex, I'm trying to use the context processors, but I'm getting the following error: http://dpaste.com/61410/ Any idea of what it might be? Thanks! Diogo On Jun 26, 11:56 am, diogobaeder wrote: > Thanks, Alex, I'll give a look at these TEMPLATE_CONTEXT_PROCESSORS to > see if they solve my

orbited tutorial .. wsgi instead of mod_python shouldn't matter?

2009-06-29 Thread Skylar Saveland
http://darkporter.com/?p=7 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django

Re: for the thousandth time... No module named django.core.handlers.modpython

2009-06-29 Thread Graham Dumpleton
On Jun 30, 12:12 pm, Rama Vadakattu wrote: > As the error is with import please try to do this > > Just open a python shell and try do the import More to the point, do it with the exact version that mod_python was compiled against and run the test as the same user that Apache runs as. This is

Re: rollback transaction without an exception when transaction is tied to http requests

2009-06-29 Thread sico
So, using automatic transaction management, there is no way to cause a transaction rollback without the user seeing the exception... stink... thanks for your help! On Jun 30, 3:07 am, Karen Tracey wrote: > On Sun, Jun 28, 2009 at 11:14 PM, sico wrote: > > > [snip] > > > However, I am still cu

Re: for the thousandth time... No module named django.core.handlers.modpython

2009-06-29 Thread Rama Vadakattu
As the error is with import please try to do this Just open a python shell and try do the import >>> import django.core.handlers.modpython if it works fine then we are sure that modpython is present on the python path and the problem is not with import .. On Jun 30, 3:31 

Django 1.0.2 Thread safety

2009-06-29 Thread Miles
There should be a little warning in the 1.0.2 docs or on http://code.djangoproject.com/wiki/DjangoSpecifications/Core/Threading that it is *not* thread safe. I've hit http://code.djangoproject.com/ticket/10470 on production, applied the patches manually. Please make sure you apply both http://cod

Re: ModelMultipleChoiceField - when is queryset updated?

2009-06-29 Thread adrian
Also this behavior is different from ModelChoiceField - which DOES seem to update immediately if an instance is added to the model. I'm using version 1.0.2 Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "D

Re: Installation on XP

2009-06-29 Thread iyank7
FloridaShark wrote: > I'd like to find and install Django in Windows XP. > Need help please, new to Python GUI environments. > Thanks My Installation quite simple - download latest python installation from python.org because i`m using SVN version, - Im Install Tortoise SVN - get the SVN version a

ModelMultipleChoiceField - when is queryset updated?

2009-06-29 Thread adrian
I had this: disciplines = forms.ModelMultipleChoiceField(queryset = Discipline.objects.all()) But if new Disciplines are created during runtime they do not appear on the list when a new form is rendered. There doesn't seem to be a mention of that fact in the documentation. So is it correct t

ModelForm for Object with ManyToManyField does not validate

2009-06-29 Thread maco
Article model has MM field to Authors. Editing an Article 123 would than be: >>> f = ArticleForm( instance=Article.objects.get(id=123) ) But than: >>> f.is_valid() False >>> f.data {} >>> f._errors {} >>> f.is_bound False Closer look at the form object "author" field: >>> f.fields['author'].

Re: Setting up TinyMCE with django-grappelli?

2009-06-29 Thread odonnell
Thanks! On Jun 29, 12:52 am, patrickk wrote: > hi chris, > > the question abouttinymceis answered/discussed at the grappelli > google-code issue-list. > > you might want to ask your question about the filebrowser setup at the > filebrowser google-group:http://groups.google.com/group/djangofilebr

Re: Installation on XP

2009-06-29 Thread dartdog
one more thing follow the example/tutorial in the django book v2 exactly,, no shortcuts,,, On Jun 29, 5:32 pm, dartdog wrote: > It is very doable but lots of stuff, I'm still working it out,, I > suggest Eclipse... with Pydev for the python env,, It can support > Django as well but that gets mor

Re: switching menu items on and off - dynamic urls?

2009-06-29 Thread Larrik Jaerico
I was afraid of middleware too, but it's really not bad at all. Just remember that the URL patterns are only processed once. On Jun 27, 7:41 am, Kenneth Gonsalves wrote: > On Friday 26 June 2009 21:19:30 Rajesh D wrote: > > > > > > I have a conference management application. It has a list of men

Re: Installation on XP

2009-06-29 Thread dartdog
It is very doable but lots of stuff, I'm still working it out,, I suggest Eclipse... with Pydev for the python env,, It can support Django as well but that gets more tricky I hope to get it all documented shortly... my travails are somewhat documented on my blog , http://tombrander.wordpress.com w

for the thousandth time... No module named django.core.handlers.modpython

2009-06-29 Thread garagefan
http://kennethdavid.net/admin error page: MOD_PYTHON ERROR ProcessId: 9659 Interpreter:'kennethdavid.net' ServerName: 'kennethdavid.net' DocumentRoot: '/home/kdwadmin' URI:'/admin' Location: '/' Directory: None Filename: '/home/kdwadmin/admin' PathI

Re: Trying to understand Django and Python from a C++ perspective

2009-06-29 Thread Mark Jones
Yea, I'm not wanting to use stuff.objects, but I'm wanting to pull some of the same voodoo, probably not safe for a python novice like myself :-) On Jun 29, 5:24 pm, Alex Gaynor wrote: > On Mon, Jun 29, 2009 at 5:19 PM, Mark Jones wrote: > > > I can't seem to reason out why/how this works. > >

Re: Trying to understand Django and Python from a C++ perspective

2009-06-29 Thread Alex Gaynor
On Mon, Jun 29, 2009 at 5:19 PM, Mark Jones wrote: > > I can't seem to reason out why/how this works. > > I have a class Named Stuff > > I can say Stuff.objects.filter(.) and that will return valid set > of data. > > What I can't understand is what exactly is objects, and why is it I > can ca

Trying to understand Django and Python from a C++ perspective

2009-06-29 Thread Mark Jones
I can't seem to reason out why/how this works. I have a class Named Stuff I can say Stuff.objects.filter(.) and that will return valid set of data. What I can't understand is what exactly is objects, and why is it I can call it with Stuff.objects, but I can't call it with stuff.objects (an

Re: Custom templatetags for loading objects

2009-06-29 Thread Joshua Partogi
On Mon, Jun 29, 2009 at 11:20 PM, Justin Lilly wrote: > > This is likely exactly what you're looking for: > > > http://www.b-list.org/weblog/2006/jun/07/django-tips-write-better-template-tags/ > > -justin > > Thanks Justin. This is really good. Regards, -- Join Scrum8.com. http://scrum8.com/me

Installation on XP

2009-06-29 Thread FloridaShark
I'd like to find and install Django in Windows XP. Need help please, new to Python GUI environments. Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to d

Model for Video Mashup

2009-06-29 Thread Dan G.
I want to create a web application that access videos from many different websites such as YouTube, Google Video, etc. The app should be able to store all the necessary information that would later allow the site to access a particular video. For instance, if the user inputs the URL http://www.you

Re: Django unicode model pickle problem

2009-06-29 Thread Danny Davidson
I wouldn't consider myself an expert with Unicdoe, but I do know that pickle and cPickle use ASCII for serialization. If you have utf-8 characters stored as attributes in the object you're pickling, that could cause the codec error. On Jun 22, 10:15 pm, Rodrigo Cea wrote: > I am having trouble

Internal redirect

2009-06-29 Thread Chichon
Hi, I've have a multilingual site where each languaje runs under one diferente "folder": www.site.com/en/ and www.site.com/es/. Everything works perfectly fine, but now I want that the user see the english version on the root path. How can I do this? --~--~-~--~~~---~-

Trying to get static media to serve from Django in Debug on windows

2009-06-29 Thread dartdog
The doc here give an example: http://docs.djangoproject.com/en/dev/howto/static-files/ Which looks like so: if settings.DEBUG: urlpatterns += patterns('', (r'^site_media/(?P.*)$', 'django.views.static.serve', {'document_root': '/path/to/media'}), ) So I put this in my Main urls fi

Re: Password-protecting PDF downloads?

2009-06-29 Thread Antoni Aloy
2009/6/29 Rajesh Dhawan : > > > > bax...@gretschpages.com wrote: >> This is probably more of a python question, but here goes: Can anyone >> point me to a method of dynamically attaching a password to a PDF and >> protecting the file before it's downloaded? Take a look at http://blog.kovyrin.net

changing apache mod python

2009-06-29 Thread Miguel
Hi all, I made an mistake of upgrading ubuntu to the last version. This new version is running python 2.6 and it has also install the mod python for apache linked to this python version. All my code is running django 0.96 with python 2.5. Now, the developments don't work. It says I have the follo

Re: Strange behavior with ModelForm and saving

2009-06-29 Thread Huuuze
StackOverflow to the rescue: http://stackoverflow.com/questions/1059831/strange-behavior-with-modelform-and-saving On Jun 29, 2:43 pm, Huuuze wrote: > This problem is very strange and I'm hoping someone can help me.  For > the sake of argument, I have a Author model with ForeignKey > relationsh

Re: no module name xxxx error

2009-06-29 Thread nixon66
my directory and subdirectories looks like this ronproject | rondata | ronapp The __init__.py file is in both the rondata and the ronapp folders. When I run manage.py runserver I get "Error: No module name rondata" I also tried to run manage.py inspectdb because my app is based on a

DRY 2 Level Navigation

2009-06-29 Thread pysports
I am currently writing a navigation system for a new site. It consists of a top level horizontal dropdown nav at the top of all the pages, along with a secondary subnav on the child pages. I have a good system working for the top level nav with DRY urls and css highlighting of the active page. Th

Re: no module name xxxx error

2009-06-29 Thread Steve Howell
On Jun 29, 11:05 am, nixon66 wrote: > I'm getting an error no module name x. I've create all the > directories and I can see them, but I keep getting this error and > can't understand why. Any ideas. Not sure why this is happening since > it did not happen when I've created other apps. Ther

Re: Redirect to html file

2009-06-29 Thread rskm1
> Hi! If I have some html file somewhere (i.e. /var/file), how to > redirect user to it? It is not a template and not in a template > folder. Thanks :) "Redirect" probably isn't the word you wanted there. If you really meant "How do I make my view function display the contents of an arbitrary HT

Re: no module name xxxx error

2009-06-29 Thread nixon66
This is an __init__.py in the folder On Jun 29, 2:08 pm, Alex Gaynor wrote: > On Mon, Jun 29, 2009 at 1:05 PM, nixon66 wrote: > > > I'm getting an error no module name x. I've create all the > > directories and I can see them, but I keep getting this error and > > can't understand why. Any

Re: no module name xxxx error

2009-06-29 Thread nixon66
Steve, The is a __init__.py On Jun 29, 2:09 pm, Steve Howell wrote: > On Jun 29, 11:05 am, nixon66 wrote: > > > I'm getting an error no module name x. I've create all the > > directories and I can see them, but I keep getting this error and > > can't understand why. Any ideas. Not sure why

Strange behavior with ModelForm and saving

2009-06-29 Thread Huuuze
This problem is very strange and I'm hoping someone can help me. For the sake of argument, I have a Author model with ForeignKey relationship to the Book model. When I display an author, I would like to have a ChoiceField that ONLY displays the books associated with that author. As such, I over

Re: Arbitrary HTTP CONNECT attempts on Django dev server

2009-06-29 Thread creecode
For those unfamiliar with what DMZ means. < http://en.wikipedia.org/wiki/DMZ_(computing) > On Jun 29, 7:27 am, Richard Shebora wrote: > yes. with no firewall protection in your case.  that is what the dmz setting > of a router is supposed to do. Toodle-looo creecode --~--~-

Re: no module name xxxx error

2009-06-29 Thread nixon66
This is an _init__.py in the folder On Jun 29, 2:08 pm, Alex Gaynor wrote: > On Mon, Jun 29, 2009 at 1:05 PM, nixon66 wrote: > > > I'm getting an error no module name x. I've create all the > > directories and I can see them, but I keep getting this error and > > can't understand why. Any i

Re: import a variable form views to forms

2009-06-29 Thread ariest
Thanks Dan. I´ve tried that but it doesnt work, there are no errors but the form doesnt display in the page. > > I think you just have to call it like this: > > form = ComentForm(request.POST, user_choices_list=children) > > I've not done it passing the POST data too, only passing in a kwarg. > >

get_or_create() returns "no such savepoint" error

2009-06-29 Thread Steve Howell
Hi, I have created a management command that populates some tables in a Postgres database, and I use the handy get_or_create() method in db/ models/query.py. I tried running a command recently where I had inadvertently left some foreign key references dangling around, but instead of a useful erro

Re: no module name xxxx error

2009-06-29 Thread Steve Howell
On Jun 29, 11:13 am, nixon66 wrote: > Steve, > > The is a __init__.py > Ok, you need to provide a little more detail then. Can you tell us what your subdirectory structure looks like, and have you put __init__.py's in enclosing folders? Sometimes modules fail to import due to syntax errors in

Re: no module name xxxx error

2009-06-29 Thread Alex Gaynor
On Mon, Jun 29, 2009 at 1:05 PM, nixon66 wrote: > > I'm getting an error no module name x. I've create all the > directories and I can see them, but I keep getting this error and > can't understand why. Any ideas. Not sure why this is happening since > it did not happen when I've created othe

no module name xxxx error

2009-06-29 Thread nixon66
I'm getting an error no module name x. I've create all the directories and I can see them, but I keep getting this error and can't understand why. Any ideas. Not sure why this is happening since it did not happen when I've created other apps. --~--~-~--~~~---~--~---

Re: import a variable form views to forms

2009-06-29 Thread Dan Radez
On 06/29/2009 10:48 AM, ariest wrote: > Sorry, this is the actual code: > > views.py > > def parent(request): > user = request.user > key = user.get_profile().link > p = Parent.objects.get(pk = key) > children = p.children.all() > if request.method == 'POST': > fo

Re: import a variable form views to forms

2009-06-29 Thread Alex Gaynor
On Mon, Jun 29, 2009 at 12:04 PM, ariest wrote: > > Nobody? > > > > Please try to be patient. This is an all volunteer mailing list and it's only been 2 hours. Many people are at work or otherwise occupied and thus unable to reply. Alex -- "I disapprove of what you say, but I will defend to

Re: Handling a reusable form in multiple views

2009-06-29 Thread delino
Perfect. I actually realized soon after posting that option 1 would work well for this scenario, but option 2 would be a good future enhancement. Thanks for your help. On Jun 29, 11:56 am, Rajesh Dhawan wrote: > delinowrote: > > Rajesh, > > > Thanks for your response. If I post the form to a de

Re: import a variable form views to forms

2009-06-29 Thread ariest
Nobody? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...

Ordering of ManyToManyField using a field of the intermediate table

2009-06-29 Thread Alex Rades
Hi, I have a couple of models like: class Album(models.Model): title = models.CharField(max_length=255) class Image(models.Model): image = models.ImageField(upload_to='images/') albums = models.ManyToManyField(Album, blank=True) the schema of the intermediate table is, of course:

Re: Getting started with django

2009-06-29 Thread mugisha moses
1.visit www.djangoproject.com . they have the best documentation 2. try experimenting with stuff. for example you can try developing a website using django. 3. you can search code.google.com or sourceforge.net for some django projects and look at the source code. cheers On Mon, Jun 29, 2009 at 7:

Re: Uploaded File Array

2009-06-29 Thread Rajesh Dhawan
BarakatX2 wrote: > When I do: > > print type(f) > > It outputs: > > > > Also when I try to get the filename using the name property of > UploadedFile, it says: > > 'str' object has no attribute 'name' > > When I just print f it shows: > > ëPNG Try something like this code: for fname, fvalue i

Re: Is it possible to access foreign-keyed properties using values_list()?

2009-06-29 Thread Rajesh Dhawan
huu...@gmail.com wrote: > I stand corrected. However, I should've been more explicit. I > created a method that combines multiple fields on the Author model. > For example: > > def Author(models.Model): > first_name = models.CharField() > last_name = models.CharField() > > def get_full_name

Re: Getting started with django

2009-06-29 Thread Rajesh Dhawan
> I have some basic of python(functional part and also very basic of oop > part), but don't have other knowledge. I would like to start with > django. So, what more is required to getting started with django so > that i can grasp all the concept and can be proficient with django. > Also is there a

Re: Is it possible to access foreign-keyed properties using values_list()?

2009-06-29 Thread huu...@gmail.com
I stand corrected. However, I should've been more explicit. I created a method that combines multiple fields on the Author model. For example: def Author(models.Model): first_name = models.CharField() last_name = models.CharField() def get_full_name(self): return self.first_name + ' ' +

Re: Password-protecting PDF downloads?

2009-06-29 Thread Rajesh Dhawan
bax...@gretschpages.com wrote: > This is probably more of a python question, but here goes: Can anyone > point me to a method of dynamically attaching a password to a PDF and > protecting the file before it's downloaded? The pyPDF library supports PDF encryption. There are probably others like

Re: Uploaded File Array

2009-06-29 Thread BarakatX2
When I do: print type(f) It outputs: Also when I try to get the filename using the name property of UploadedFile, it says: 'str' object has no attribute 'name' When I just print f it shows: ëPNG On Jun 29, 10:48 am, Rajesh D wrote: > On Jun 29, 11:05 am, BarakatX2 wrote: > > > I have a

Re: add other field for django admin user

2009-06-29 Thread Rajesh Dhawan
> Suppose I have UserPref with attribute phone and detail > Is it possible to add UserPref.phone and UserPref.detil in edit form > in django user admin? You can provide a custom form that has your additional fields and knows how to save them. See: http://docs.djangoproject.com/en/dev//ref/contri

Re: Handling a reusable form in multiple views

2009-06-29 Thread Rajesh Dhawan
delino wrote: > Rajesh, > > Thanks for your response. If I post the form to a dedicated view that > works fine, but how do I handle validation properly in this approach. > Say the user enters invalid data, do I now need to redirect them back > to the original page and then display these errors?

Re: http://www.djangobook.com/en/2.0/chapter03/

2009-06-29 Thread djangonoob
oh 0k. thanks dude! I was about to declare that myself. Thanks! On Jun 29, 11:45 pm, Alex Gaynor wrote: > On Mon, Jun 29, 2009 at 10:39 AM, djangonoob wrote: > > > Hi all, > > i am following the tutorial on the link in the subject, > >http://www.djangobook.com/en/2.0/chapter03/ > > and i ran

Re: Uploaded File Array

2009-06-29 Thread Rajesh D
On Jun 29, 11:05 am, BarakatX2 wrote: > I have a form that allows a dynamic number of files to be uploaded. On > the Django side, if I print the request.FILES it is described as: > > png)>, , > ]}> > > But when I try to access the files like this: > > for f in files['rqFiles']: > > Then f is a

Re: http://www.djangobook.com/en/2.0/chapter03/

2009-06-29 Thread Alex Gaynor
On Mon, Jun 29, 2009 at 10:39 AM, djangonoob wrote: > > Hi all, > i am following the tutorial on the link in the subject, > http://www.djangobook.com/en/2.0/chapter03/ > and i ran into some trouble. > > > from django.conf.urls.d

RE: http://www.djangobook.com/en/2.0/chapter03/

2009-06-29 Thread djangonoob
Hi all, i am following the tutorial on the link in the subject, http://www.djangobook.com/en/2.0/chapter03/ and i ran into some trouble. from django.conf.urls.defaults import * from mysite.views import hello, current_datetime, h

Re: Handling a reusable form in multiple views

2009-06-29 Thread delino
Rajesh, Thanks for your response. If I post the form to a dedicated view that works fine, but how do I handle validation properly in this approach. Say the user enters invalid data, do I now need to redirect them back to the original page and then display these errors? That seems like it will be

Re: rollback transaction without an exception when transaction is tied to http requests

2009-06-29 Thread Karen Tracey
On Sun, Jun 28, 2009 at 11:14 PM, sico wrote: > > [snip] > > However, I am still curious if there is a way to tell django to not > commit the transaction without the user seeing an exception > > Yes and no: I tried to describe that in my previous answer. Yes, you can arrange to have the tran

Uploaded File Array

2009-06-29 Thread BarakatX2
I have a form that allows a dynamic number of files to be uploaded. On the Django side, if I print the request.FILES it is described as: , , ]}> But when I try to access the files like this: for f in files['rqFiles']: Then f is a string with some ascii characters including the file extension.

Re: import a variable form views to forms

2009-06-29 Thread ariest
Sorry, this is the actual code: views.py def parent(request): user = request.user key = user.get_profile().link p = Parent.objects.get(pk = key) children = p.children.all() if request.method == 'POST': form = ComentForm(request.POST, children???) if form.is_va

Re: Is it possible to access foreign-keyed properties using values_list()?

2009-06-29 Thread Karen Tracey
On Mon, Jun 29, 2009 at 10:27 AM, huu...@gmail.com wrote: > > I'd like to use values_list() to populate a choices attribute. > However, I need to access some foreign-keyed properties to properly > display the information. > > For example: > > >> Books.objects.values_list('id', 'author__name') > >

Re: Arbitrary HTTP CONNECT attempts on Django dev server

2009-06-29 Thread Richard Shebora
yes. with no firewall protection in your case. that is what the dmz setting of a router is supposed to do. On 6/29/09, chefsmart wrote: > > > Hi, > > Thanks for your descriptive answer. > > I'm starting the development server with python manage.py runserver > 192.168.1.110:8000 > > This is so th

Is it possible to access foreign-keyed properties using values_list()?

2009-06-29 Thread huu...@gmail.com
I'd like to use values_list() to populate a choices attribute. However, I need to access some foreign-keyed properties to properly display the information. For example: >> Books.objects.values_list('id', 'author__name') Currently, it doesn't appear to be working. --~--~-~--~~---

Re: regex problem in django

2009-06-29 Thread James Gregory
On Jun 29, 2:57 pm, Joru wrote: > Still doesn't work even I remove wrap function :( So it seems your regex is incorrect, the problem is not related to Django. If you paste your code here I can have a look, but I still think you'd be better off reading a bit more about regular expressions yours

import a variable form views to forms

2009-06-29 Thread ariest
Hello, I want to use a objects list in a ChoiceField of a form that I have in forms.py but I dont know how to do it. views.py def parent(request): user = request.user key = user.get_profile().link p = Parent.objects.get(pk = key) children = p.children.all() if request.method

Re: Redirect to html file

2009-06-29 Thread Alex Gaynor
On Mon, Jun 29, 2009 at 6:11 AM, Daniel Roseman wrote: > > On Jun 29, 9:23 am, alecs wrote: > > Hi! If I have some html file somewhere (i.e. /var/file), how to > > redirect user to it? It is not a template and not in a template > > folder. Thanks :) > > It needs to be somewhere the webserver can

add other field for django admin user

2009-06-29 Thread Joru
Hi, Suppose I have UserPref with attribute phone and detail Is it possible to add UserPref.phone and UserPref.detil in edit form in django user admin? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gr

Re: regex problem in django

2009-06-29 Thread Joru
Still doesn't work even I remove wrap function :( On Jun 29, 7:35 pm, James Gregory wrote: > On Jun 29, 1:05 pm, Joru wrote: > > > I'm sorry for my typo > > the string var suppose to be like this > > str = "wr:\n one bunny \n two bunny \n wr:\n three bunny \n > > So every match string "wr:" sho

Password-protecting PDF downloads?

2009-06-29 Thread bax...@gretschpages.com
This is probably more of a python question, but here goes: Can anyone point me to a method of dynamically attaching a password to a PDF and protecting the file before it's downloaded? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Custom templatetags for loading objects

2009-06-29 Thread Justin Lilly
This is likely exactly what you're looking for: http://www.b-list.org/weblog/2006/jun/07/django-tips-write-better-template-tags/ -justin On Mon, Jun 29, 2009 at 9:16 AM, Joshua Partogi wrote: > Dear all, > Currently I want to make a custom templatetags for loading objects to be > looped over.

Custom templatetags for loading objects

2009-06-29 Thread Joshua Partogi
Dear all, Currently I want to make a custom templatetags for loading objects to be looped over. Is there any reference that I should be reading? Kind regards, -- Join Scrum8.com. http://scrum8.com/member/jpartogi/ http://scrum8.com/blog/jpartogi/ http://twitter.com/scrum8 --~--~-~--~--

Re: subdomains cookie problem

2009-06-29 Thread Stephen Cheng
Hi Raja This looks great. Thanks for helping out. Stepehn On Jun 29, 9:17 pm, Raja wrote: > Setup thecookie.domain attribute value to '.mydomain.com' (The first > dot is important) and all hosts in that domain will get thecookie. > > -- Raja > > On Jun 29, 4:01 pm, Stephen Cheng wrote: > > >

Re: regex problem in django

2009-06-29 Thread James Gregory
On Jun 29, 1:05 pm, Joru wrote: > I'm sorry for my typo > the string var suppose to be like this > str = "wr:\n one bunny \n two bunny \n wr:\n three bunny \n > So every match string "wr:" should had "+" in front of it line > the one that confuse me is that my function work in django/python > s

Re: Get Users' Groups

2009-06-29 Thread Gil Sousa
Thanks :) And where can I see the whole Group Documentation? All the fields we have available (and their names), etc... On 25 Jun, 18:02, Daniel Roseman wrote: > On Jun 25, 2:45 pm, Gil Sousa wrote: > > > Hi! > > > I searched on documentation but I didn't see anything related with > > managing

Re: regex problem in django

2009-06-29 Thread Joru
I'm sorry for my typo the string var suppose to be like this str = "wr:\n one bunny \n two bunny \n wr:\n three bunny \n So every match string "wr:" should had "+" in front of it line the one that confuse me is that my function work in django/python shell, but this regex doesn't work well if i cal

Re: Linking css file to the template

2009-06-29 Thread Daniel Roseman
On Jun 29, 12:33 pm, atik wrote: > I am working on a simple django project. I have tried to link the css > file, but it's not working. If i run the html template directly, then > it's ok. but if i run the server, then its not working. What to do? Read the documentation: http://docs.djangoproject

Linking css file to the template

2009-06-29 Thread atik
I am working on a simple django project. I have tried to link the css file, but it's not working. If i run the html template directly, then it's ok. but if i run the server, then its not working. What to do? --~--~-~--~~~---~--~~ You received this message because yo

Re: Is IP address caching built into the Django Framework?

2009-06-29 Thread James
On Jun 29, 8:13 am, Vladimir Shulyak wrote: > > You can't rely on just the IP. If you do then you will have problems > > where large numbers of people sit behind a single IP, as will be case > > where corporate firewall is used, or where proxies or other gateway or > > NAT solution are used by IS

Django-profile-images

2009-06-29 Thread Leidson Germano
Hey guys, Anybody know the type of object "user" in {% profile_image user 64x64 %} 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@goo

Re: subdomains cookie problem

2009-06-29 Thread Raja
Setup the cookie.domain attribute value to '.mydomain.com' (The first dot is important) and all hosts in that domain will get the cookie. -- Raja On Jun 29, 4:01 pm, Stephen Cheng wrote: > Yes, I check the cookie value in view or in middleware class. > > Just give example, eg, I want the brows

Re: Base view class ?

2009-06-29 Thread Daniel Guryca
"In my experience the biggest benefit of class-based views are when you are doing a bunch of similar stuff that's just a tiny bit different, for which you can just subclass the view class for the bits you need to change" Yap ... that's exactly why I'm looking for a class-based views. thank you D

Re: Sharing a development site cheaply (free as in beer?)

2009-06-29 Thread Tim Kersten
> Currently GAE only supports django 0.96. Besides that, there are several > django features that is not available on GAE such as: session middleware and > django model which in effect django admin and django auth is not runnable on > it too. But it's quite worth it for your needs I reckon. Um, i

Re: Redirect to html file

2009-06-29 Thread Daniel Roseman
On Jun 29, 9:23 am, alecs wrote: > Hi! If I have some html file somewhere (i.e. /var/file), how to > redirect user to it? It is not a template and not in a template > folder. Thanks :) It needs to be somewhere the webserver can see it. Ideally you'd put in the same place as the rest of your stat

Re: Base view class ?

2009-06-29 Thread Justin Lilly
It's also worth noting that you _can_ use a class for a view. Views just have to be python callables. For more info on this, check out Marty Alchin's Pro Django and the python doc's for __call__. In my experience the biggest benefit of class-based views are when you are doing a bunch of sim

Redirect to html file

2009-06-29 Thread alecs
Hi! If I have some html file somewhere (i.e. /var/file), how to redirect user to it? It is not a template and not in a template folder. Thanks :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

Re: subdomains cookie problem

2009-06-29 Thread Stephen Cheng
Yes, I check the cookie value in view or in middleware class. Just give example, eg, I want the browser to remember online user's city, so next time when they type www.mydomain.com, it will be diverted to cityx.mydomain.com. Now the problem is that: 1. When I setup a cookie varible cityname=ci

Re: About django.root

2009-06-29 Thread mugisha moses
can you try PROJECT_PATH = os.path.dirname(os.path.abspath(__file__)) in your django settings.py file? cheers On Sun, Jun 28, 2009 at 7:09 PM, Frank Abel wrote: > > Hi all, > > I'm using mod_python and have "PythonOption django.root" set. > > My question is, how can I access that var (my site de

Re: Sharing a development site cheaply (free as in beer?)

2009-06-29 Thread Joshua Partogi
On Mon, Jun 29, 2009 at 1:40 PM, Steve Hershman wrote: > > Introduction: > Hi Everyone, > Django is awesome and I hear you're all really helpful. I'm looking > forward to joining this group. > > Real message: > > So I'm developing a site with a few friends. We do not have a > dedic

Getting started with django

2009-06-29 Thread atik
I have some basic of python(functional part and also very basic of oop part), but don't have other knowledge. I would like to start with django. So, what more is required to getting started with django so that i can grasp all the concept and can be proficient with django. Also is there any way to

Re: regex problem in django

2009-06-29 Thread James Gregory
On Jun 29, 11:19 am, Joru wrote: > ah, I just want to match in the end of line only > so change the rule "wr$" would get what I want? > > > Square brackets are for character groups, not literal strings. "wr:" > > is just a string so it should be "wr:", not "[wr:]". Also, you want to > > match t

Re: Base view class ?

2009-06-29 Thread Raja
You could use decorators (following the Decorator pattern) to do pre/ post interceptors. For e.g. http://docs.djangoproject.com/en/dev/topics/auth/#django.contrib.auth.decorators.login_required shows a login_required decorator to make sure that those views can only be accessed after logging in. -

  1   2   >