Setting up a MultiValueField + custom model field in admin

2009-11-29 Thread Justin
Hi guys, Trying to teach myself a bit about creating custom fields (for both forms and models) for Django. Starting off with a somewhat contrived storing a street address in one field. I seem to have gotten the model field working, as I can run python manage.py shell and successfully fill out th

Re: ModelMultipleChoiceField with checkboxes: How to generate the HTML "checked" option?

2009-11-29 Thread Nick Arnett
On Sun, Nov 29, 2009 at 8:30 PM, Gloria wrote: > Here's the line from my model: > class UserProfile(models.Model): >some other fields... >privacy_options = models.ManyToManyField(PrivacyOption, > blank=True, null=True, db_table = 'usr_privacy_selection') > > Here's the bit from my form: >

Re: ModelMultipleChoiceField with checkboxes: How to generate the HTML "checked" option?

2009-11-29 Thread Gloria
Here's the line from my model: class UserProfile(models.Model): some other fields... privacy_options = models.ManyToManyField(PrivacyOption, blank=True, null=True, db_table = 'usr_privacy_selection') Here's the bit from my form: class ModifyProfileForm(forms.Form): some other fields..

Re: Trouble Getting Past the Congratulations Page

2009-11-29 Thread Guze
Karen, restarting apache worked instantly. I'm not used to having to do that. Normally it's the browser caching the old page that drives you crazy. Fortunately I have some aliases for starting, stopping, restarting etc that make this really painless. The idea of using the dev server has a lot o

Re: django url and reverse

2009-11-29 Thread Karen Tracey
On Sun, Nov 29, 2009 at 6:45 AM, caliman wrote: > Hi! > > In my project most of my views requires the user to be logged in but > in some i don't for example the login view wich only displays a login > form. When I'm going to the login form as a non logged in user I get > an error: > "Error was: '

Re: Trouble Getting Past the Congratulations Page

2009-11-29 Thread Karen Tracey
On Sun, Nov 29, 2009 at 8:06 PM, Guze wrote: > I have spent time > looking at the django project tutorials, but they are pretty tied into > the development webserver which I cannot run since I have to browser > (or monitor or keyboard) connected to that hardware server. You do not need a monit

Re: django url and reverse

2009-11-29 Thread Skylar Saveland
You simply can't call request.user.get_profile() on an anonymous user. caliman wrote: > Hi! > > In my project most of my views requires the user to be logged in but > in some i don't for example the login view wich only displays a login > form. When I'm going to the login form as a non logged in u

Trouble Getting Past the Congratulations Page

2009-11-29 Thread Guze
I've been using the book "Python Web Development with Django" to get up to speed on this amazing framework. Although I'm new to python, I have plenty of experience with other languages like C and lately PHP, as well as running my own linux servers using apache2 for websites. I've been flipping pag

unsubscribe

2009-11-29 Thread turbogears
在2009-11-30 09:36:28,"Steve Holden" 写道: On Sun, Nov 29, 2009 at 8:33 PM, Nick Arnett wrote: On Sun, Nov 29, 2009 at 4:01 PM, Steve Holden wrote: Not at all. The client will typically use an "ephemeral" port (one it obtains by saying to its local TCP layer "gimme a port number, I don'

Re: WebFaction warning

2009-11-29 Thread David Zhou
On Sun, Nov 29, 2009 at 9:18 PM, digicase wrote: > I received a good email From Remi at WF which told me all I needed to > know. The outage was unacceptable but hopefully lessons have been > learned. Do you mind sharing what he said? I'd be curious to know if any new controls have been put into

Re: WebFaction warning

2009-11-29 Thread digicase
On Nov 29, 5:52 pm, Atamert Ölçgen wrote: > On Saturday 28 November 2009 07:28:27 digicase wrote:> I am sad to report > this, as up until now I had complete faith and > > trust in them. That has been lost over the past few days. Support were > > not transparent, status updates rare and vague. > >

Re: how to get remote port number

2009-11-29 Thread Steve Holden
On Sun, Nov 29, 2009 at 8:33 PM, Nick Arnett wrote: > On Sun, Nov 29, 2009 at 4:01 PM, Steve Holden wrote: > > >> >>> Not at all. The client will typically use an "ephemeral" port (one it >> obtains by saying to its local TCP layer "gimme a port number, I don't care >> what it is"). The connect

Re: how to get remote port number

2009-11-29 Thread Nick Arnett
On Sun, Nov 29, 2009 at 4:01 PM, Steve Holden wrote: > > >> Not at all. The client will typically use an "ephemeral" port (one it > obtains by saying to its local TCP layer "gimme a port number, I don't care > what it is"). The connection (any connection) has *two* endpoints, and the > port numb

What exactly does order_with_respect_to do?

2009-11-29 Thread Continuation
In the doc (http://docs.djangoproject.com/en/dev/ref/models/options/ #order-with-respect-to) it is mentioned that order_with_respect_to marks an object as "orderable" with respect to a given field. What exactly does that mean? Can someone give me an example of how this could be used? The doc's

Re: Save as new and files

2009-11-29 Thread Pawel Pilitowski
Hi Tim, Thanks for the response. My Test model: class Test(models.Model): text = models.CharField(max_length=50) image = models.ImageField(upload_to="upload/test_images/", blank=True, null=True) #also tried with FileField def __unicode__(self): return self.text c

Re: how to get remote port number

2009-11-29 Thread Steve Holden
On Sun, Nov 29, 2009 at 6:56 PM, Nick Arnett wrote: > > > On Sun, Nov 29, 2009 at 2:24 PM, The New Hanoian wrote: > >> Hi, >> >> I'm learning Django. In the tutorial i find that the client IP address >> can be retrieve through HttpRequest.META["REMOTE_ADDR"]. But I >> couldn't find a way to retri

Re: how to get remote port number

2009-11-29 Thread Nick Arnett
On Sun, Nov 29, 2009 at 2:24 PM, The New Hanoian wrote: > Hi, > > I'm learning Django. In the tutorial i find that the client IP address > can be retrieve through HttpRequest.META["REMOTE_ADDR"]. But I > couldn't find a way to retrieve the client port number. I think it > should be obvious. Am I m

Re: Chart tool

2009-11-29 Thread Steve S.
For in-page charts, I use flot, as Javier suggested. I plan to look into pycha based on Skylar's suggestion, though. There is no need for client-side chart drawing with my use case. On Nov 25, 3:31 pm, Javier Guerra wrote: > reportlab allows you to generate PDFs, which can be as high quality as

Re: A Design Question

2009-11-29 Thread Steve S.
This /is/ outside the scope of Django. "Database normalization" and "Database design" are the google query you're looking for to learn more about this, though. Here are some links that may steer you in the right direction: http://en.wikipedia.org/wiki/Database_normalization http://databases.about

Re: How do I tap into admin.py to generate data from models?

2009-11-29 Thread Russell Keith-Magee
On Mon, Nov 30, 2009 at 1:45 AM, Joshua Kramer wrote: > Hello, > > What document or example code should I consult to learn how to tap > into admin.py to output specific data based on a model?  For example, > if I have an application and a handful of models, if I do "admin.py > sqlall" then I get o

how to get remote port number

2009-11-29 Thread The New Hanoian
Hi, I'm learning Django. In the tutorial i find that the client IP address can be retrieve through HttpRequest.META["REMOTE_ADDR"]. But I couldn't find a way to retrieve the client port number. I think it should be obvious. Am I missing something? -- You received this message because you are sub

Re: ModelMultipleChoiceField with checkboxes: How to generate the HTML "checked" option?

2009-11-29 Thread levin11
Hi, I tried to post this two hours ago, but it did not show up. So sorry if this is the second copy. I use "checkboxed" ModelMultipleChoiceField w/o any problems. Here is a snippet: class PictureForm(ModelForm): tags = ModelMultipleChoiceField(queryset=Tag.objects.all(), widget=CheckboxSelec

Re: ModelMultipleChoiceField with checkboxes: How to generate the HTML "checked" option?

2009-11-29 Thread levin11
I have ModelMultipleChoiceField working for me OK, but I am not sure I understand your question. Could you be a bit more specific? This is a snippet from my code which may or may not help: class PictureForm(ModelForm): tags = ModelMultipleChoiceField(queryset=Tag.objects.all(), widget=Checkbo

Re: ModelMultipleChoiceField with checkboxes: How to generate the HTML "checked" option?

2009-11-29 Thread Nick Arnett
On Sun, Nov 29, 2009 at 9:52 AM, Gloria wrote: > Thanks for the response. I am trying to do this on the server side. > Here is more detail. > I am initializing it to all unchecked checkboxes in my forms.py. > Then, in my view, I am trying to have HTML generate a "checked" value > for certain chec

Re: streaming response, missing something simple

2009-11-29 Thread Preston Holmes
On Nov 28, 11:07 pm, Preston Holmes wrote: > My expectation was that it was possible to 'stream' a response back to > a browser from a view, where that response is 'trickled' onto the > browser page.  I had done this a while back in cherrypy and it worked > as expected. > > a super simple view d

A Design Question

2009-11-29 Thread Ramdas S
This is probably outside Django. But I am checking out since I am building it with Django. I am building a specialized closed group social networking web site for special set of medical practitioners. Idea for my client is to be a mini- LinkedIn of sorts for this small community. We want to captu

Re: Difficulty using anchor tags in templates

2009-11-29 Thread Andy
Fantastic! I think I was overthinking my problem. Thanks a lot! On Nov 29, 10:36 am, rebus_ wrote: > BTW here is an example: > > When you click this > link:http://en.wikipedia.org/wiki/Fragment_identifier#Processing > > your browser will open uphttp://en.wikipedia.org/wiki/Fragment_identifierp

Re: ModelMultipleChoiceField with checkboxes: How to generate the HTML "checked" option?

2009-11-29 Thread Gloria
Thanks for the response. I am trying to do this on the server side. Here is more detail. I am initializing it to all unchecked checkboxes in my forms.py. Then, in my view, I am trying to have HTML generate a "checked" value for certain checkboxes, based on some user data I received in that view. Ho

How do I tap into admin.py to generate data from models?

2009-11-29 Thread Joshua Kramer
Hello, What document or example code should I consult to learn how to tap into admin.py to output specific data based on a model? For example, if I have an application and a handful of models, if I do "admin.py sqlall" then I get output that consists of SQL statements used to generate the model i

App engine launcher on windows problem

2009-11-29 Thread knight
I'm trying to install app engine with django 1.1 on windows. When launching the app engine I'm getting the following error: http://slexy.org/view/s21oLrbkHh The steps I do are: 1.) Create new app via launcher 2.) Copy my code (Which is empty django project) My main.py code: http://slexy.org/view/

Re: ModelMultipleChoiceField with checkboxes: How to generate the HTML "checked" option?

2009-11-29 Thread Nick Arnett
On Sat, Nov 28, 2009 at 3:05 PM, Gloria wrote: > Hi all, > I've spent way too much time getting trying to get this widget to work > the way I am envisioning. > In the forms, I want to initialize it, but in the view I need to > determine which boxes are checked. > Has anyone done this without writ

Re: Difficulty using anchor tags in templates

2009-11-29 Thread rebus_
BTW here is an example: When you click this link: http://en.wikipedia.org/wiki/Fragment_identifier#Processing your browser will open up http://en.wikipedia.org/wiki/Fragment_identifier page and then scroll down to the Processing title without wikipedia even knowing that you specifically want to s

Re: Difficulty using anchor tags in templates

2009-11-29 Thread rebus_
I have seem to overcomplicated and I hope i understand your question right :) You just need to render the template with your titles and content (i guess you call it resources). If you have a link such as link anywhere on your site, once you click on it you should return HttpResponse and render yo

Re: Dynamicly preset forms in the admin interface

2009-11-29 Thread rebus_
2009/11/29 Kai Timmer : > 2009/11/29 rebus_ : >> Have you tried using fieldsets [1] in you ModelAdmin. Also you can >> override save_model method on the ModelAdmin to set values for some >> object attributes when the object is being saved [2]. > > I don't see how I can use fieldsets to achieve this

Re: Error: No module named polls

2009-11-29 Thread Vardhan Varma
did you named your project as 'mysite' and your app as 'polls' ... also make sure __init__.py exists inside directory polls (manage.py should create that ). hope that helps, --Vardhan On Sun, Nov 29, 2009 at 7:12 PM, Baba Samu wrote: > Hi, > > Following the tutorial when i have "python mana

Re: Dynamicly preset forms in the admin interface

2009-11-29 Thread Vardhan Varma
I do not know how to do this in admin, but in your own form do this peter = article( author = "Peter" ) myform = TheFormClass ( instance = peter ) hope that helps, --Vardhan On Sun, Nov 29, 2009 at 8:41 PM, Kai Timmer wrote: > 2009/11/29 rebus_ : > > Have you tried using fieldsets [1]

Re: Difficulty using anchor tags in templates

2009-11-29 Thread Andy
Hmm, still not clear. My url is simply this: (r'^resources/$', views.resources) I have read that I need to use HttpResponseRedirect to make use of #anchor tags. Is this not the case? Thanks for your help! On Nov 29, 8:38 am, rebus_ wrote: > 2009/11/29 Andy : > > > > > > > I have a model name

Re: Dynamicly preset forms in the admin interface

2009-11-29 Thread Kai Timmer
2009/11/29 rebus_ : > Have you tried using fieldsets [1] in you ModelAdmin. Also you can > override save_model method on the ModelAdmin to set values for some > object attributes when the object is being saved [2]. I don't see how I can use fieldsets to achieve this. I thought with the fieldsets I

Re: How to list all parents and their children if any?

2009-11-29 Thread Mario
Hi, You mentioned that you could have used a m2m between Connector and Cable, but it sounded that you opted out. I could be wrong, but to get the desired report to display, I think you may need to revisit your models.py and use the "_set" used in m2m relationships. _mario On Nov 28, 11:50 pm,

Re: Chart tool

2009-11-29 Thread Kevin Renskers
I am using the Google Visualization API myself, it's pretty nice. I wrote a blog post with a little how to: http://www.bolhoed.net/blog/using-the-google-visualization-api-in-django/ However, I also used FusionCharts in the past and that's got my vote too :) On Nov 25, 9:07 pm, "S.Selvam" wrote: >

Re: Difficulty using anchor tags in templates

2009-11-29 Thread rebus_
2009/11/29 Andy : > I have a model named Articles with title and content fields.  Each > page of my site should display a list of the titles, linked with > anchor tags to the corresponding area of the Resources page which > displays all the titles and content.  I am having trouble figuring out > ho

Re: Dynamicly preset forms in the admin interface

2009-11-29 Thread rebus_
2009/11/29 Kai Timmer : > Hello, > I'm new to django, so this question may look a bit stupid, but I > couldn't find the information in the documentation. > > I have a pretty simple model which looks like this: > class article(models.Model): >  headline = models.CharField(max_length=140) >  newsentr

Re: How to list all parents and their children if any?

2009-11-29 Thread adelaide_mike
Thanks Karen yet again. Am I right in thinking that this cannot be a symetrical arrangement ie: connector can access values from cable(s) and cable can access values from connector(s) It does not appear to be possible to put a ManyToManyField in both the "parent' models, because one must be decl

Error: No module named polls

2009-11-29 Thread Baba Samu
Hi, Following the tutorial when i have "python manage.py sql polls" i get error message "No module named polls" I have modified settijng.py to. INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'mys

Dynamicly preset forms in the admin interface

2009-11-29 Thread Kai Timmer
Hello, I'm new to django, so this question may look a bit stupid, but I couldn't find the information in the documentation. I have a pretty simple model which looks like this: class article(models.Model): headline = models.CharField(max_length=140) newsentry = models.TextField() pub_date = m

Re: WebFaction warning

2009-11-29 Thread Atamert Ölçgen
On Saturday 28 November 2009 07:28:27 digicase wrote: > I am sad to report this, as up until now I had complete faith and > trust in them. That has been lost over the past few days. Support were > not transparent, status updates rare and vague. I have been following web44 issues from RSS and it sur

Difficulty using anchor tags in templates

2009-11-29 Thread Andy
I have a model named Articles with title and content fields. Each page of my site should display a list of the titles, linked with anchor tags to the corresponding area of the Resources page which displays all the titles and content. I am having trouble figuring out how to pass the #title info.

Re: Chart tool

2009-11-29 Thread Tim Langeman
We're using AnyChart. It is similar to Fusion Charts in that it is an XML data source that is rendered on the client side with a Flash SWF. http://www.anychart.com I don't think AnyChart has a free version, so you'll have to look into the licensing arrangements to see if it is worth it for you

Re: german umlaute on search querys

2009-11-29 Thread Hinnack
Hi Karen, thanks for investigating... I solved the problem. There were 2 reasons: - php code non passing correct encoded POST - urllib.unquote_plus not working as expected and not for last that the raw_post_data is not decoded and a POST var is... (my blindness) Thanks again for your help. -- H

django url and reverse

2009-11-29 Thread caliman
Hi! In my project most of my views requires the user to be logged in but in some i don't for example the login view wich only displays a login form. When I'm going to the login form as a non logged in user I get an error: "Error was: 'AnonymousUser' object has no attribute 'get_profile'" The error

Re: View returns no queryset

2009-11-29 Thread Daniel Roseman
On Nov 28, 11:15 pm, "R. Gorman" wrote: > I've got a real stumper. Well, a stumper for me; I'm hoping someone > has some insight. Here's the view I'm calling: > > >     games = Game.objects.all() >     return render_to_response('season_schedule.html', > {games:"object_list"},context_instance = Re

Re: CSRF Flatpages

2009-11-29 Thread rebus_
2009/11/28 John Leith : > I have a problem with the CSRF framework, and i'm just checking here > to see if anyone else ran into this problem and hopefully found a > solution. Here is my problem: > > I have a login form on the base template of my site. The home page is > just a flatpage. My login pr

Re: Chart tool

2009-11-29 Thread John M
We started playing with FusionCharts, they have a free version which is pretty slick. It's flash based, and not sure about the printing aspect yet. It's generated with some XML and an SWF file. J On Nov 25, 12:07 pm, "S.Selvam" wrote: > Hi all, > > This is my first post here andi  am new to dj

Re: Installation Problem on Mac OS Leopard

2009-11-29 Thread John M
Me too, I'm not having any issues. I just installed on 10.6 by downloading 1.1.1 and running the install command sudo python setup.py install and no issues. After install I run django-admin.py --version and it shows 1.1.1 You'll need to give us more info to help. Are you using sudo? What versi

Re: View returns no queryset

2009-11-29 Thread John M
I suspect that the query isn't being executed, cause you're not accessing any elements? have you tried to print games and see what comes out? passing {games:"object_list"} seems like it should make sense, but since I'm not an expert on Python or django, I'd imagine that the "object_list" isn't be