Do I understand the support schedule correctly?
I'm considering using Django for 2 projects. An LFS shop and a site which will use Pinax. Both high profile Django apps. At this time, the latest supported Django version for both is 1.3.3. If I understand correctly, the 1.3 branch of Django will no longer get security updates after 1.5 releases. The nominal release cycle for Django appears to be 9 months. And in practice it looks more like 1 year. So Django 1.5 should be out sometime between December and March. If I deploy in a month, that means a forced upgrade on both framework and apps in just 3 to 6 months from launch. And that's assuming that the apps have versions which support Django 1.4 by that time. Obviously, I'm missing something here, since no sane organization would accept such a situation. (It would certainly be a deal-breaker for us.) But I'm not sure what it is that I'm missing. -- 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...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Adding new forms dynamically to the page?
I'm not expert at this. I've only used formsets a little, and I've never added any dynamically. But depending upon your requirements, you could define the formset with an adequate number of "extra=" forms and have the javascript hide most of them by default, displaying an additional one each time a button is pressed. I believe that formsets are smart enough to simply ignore extra forms, which have not been filled in, during validation. This might be simpler than generating the forms on the fly in javascript. And in this case you would not have to worry about modifying the management form. But like I say, I'm no whiz at this. -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: Adding new forms dynamically to the page?
When you add a form with javascript, you must also increment the hidden field in the management form which holds the form count. Actually, you'll need to read that field before you add the form to determine what the proper ids and names for the new input elements should be. Validation will then expect and validate that number of forms when the user submits. -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: Cascading List List Boxes
You will need to display the dependent ChoiceField empty at first, but set the first ChoiceField to submit the form "onchange". (I like to use the JQuery events system for this, but you can do it with "attr".) Then have the view redisplay the form with the dependent ChoiceField populated. IIRC, to get dynamic choice fields you have to override __init__() in the form to accept a "choices" argument and use it to set the choices at form instantiation time rather than once when the class is defined. You can set initial *values* at instantiation time, but not choices. That's always seemed awfully clunky to me, as this is a fairly common need. Would dynamic choices be a reasonable request for 1.1, I wonder? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Formset in template with extra per form
I have a formset, each form representing a row in a table. I also have a list of dictionaries, each list item providing additional data to print on that row. The formset and list of dictionaries are of arbitrary lengths, and potentially in the hundreds or even low thousands, so efficiency counts. I also want to keep the logic as simple and clear as possible. I would like to be able to loop over both at once in the template while rendering the table, but I don't see a good way to do that with Django templates. And I don't see an obvious way to efficiently zip up 'formset.forms' with 'items' to do things that way, But I don't have the deepest understanding of formsets, so perhaps that is possible. Any thoughts? Thanks, Steve Bergman --~--~-~--~~~---~--~~ 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: Many to Many where two fields in one model are related
Thank you. That looks to be exactly what I need. I remember seeing that on the ToDo list leading up to 1.0, but didn't realize how it applied to my situation. -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 -~--~~~~--~~--~--~---
Many to Many where two fields in one model are related
I had trouble coming up with a decriptive "subject" for this. Sorry. I'm working on an app for planning balanced daily diets. And I'm having trouble figuring out how to set up my models. I have: Ingredient(models.Model): ingredient_name = CharField(max_length=50) unit = CharField(max_length=15) calories = DecimalField(max_digits=6, decimal_places=2) Recipe(models.Model): recipe_name = CharField(max_length=50) ingredients = ManyToMany(Ingredient) amount = DecimalField(max_digits=6, decimal_places=2) An ingredient can be in many recipes and a recipe has many ingredients. The thing is, in a Recipe I want to have an arbitrary number of ingredients, and I need for each ingredient to be associated with an amount. I could use multiple ForeignKey fields from in Recipe to Ingredient, and multiple amount fields in Recipe, but that seems klunky. Is there a "right" way to do this? Thanks, Steve Bergman --~--~-~--~~~---~--~~ 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: Striped tables in Django
Look up the "cycle" template tag. It will do exactly what you want. --~--~-~--~~~---~--~~ 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: ajax toolkit suggest request
On Jan 20, 6:49 am, Artiom Diomin <[EMAIL PROTECTED]> wrote: > Seems like you want someone write it for you? > It costs money :) It's good that he provided a description of what he wanted to accomplish. What he wants does not really require ajax. A bit of javascript might make it nicer. To the OP: You could do this without ajax if you don't mind a page reload, simply with an "onchange" attribute on the checkboxes and some extra logic in the view. Checking the box would submit the form and redisplay the whole page with the desired changes. Or you could have the user check the box and click submit without the "onchange". No actual ajax is required, in that there need be asynchronous conversation between the browser and the server. If you have not already, go to new.djangobook.com and read chapter 7 on form processing. Make sure you understand it. Visit the excellent newforms reference in the Django doc. Look at the onchange attribute for checkboxes to see how to make a form autosubmit on a change to a field, and I think you will see how to do what you describe in a straightforward fashion. If you do want to get into javascript on your sites, I'm far from an expert, but I have used Mochikit (with TurboGears) and am starting to learn jquery with DJango. Jquery seems quite nice. The interface is very clean and works in a very straightforward way. It leverages CSS, and feels very pythonic to me. It seems very natural. There is good documentation available at http://docs.jquery.com/Main_Page . and I bought the "Learning Jquery" book, too. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Status of iterative rendering?
Last June there was some work done on iterative rendering of templates, generating the out on the fly, directly down the connection to the browsers rather than rendering the whole thing in memory and then sending it. The issue turned out to be more complicated than it appeared on the surface, and the patches were deferred. Has there been any progress on this? I write reporting apps which can generate exremely long (memory hungry) reports. I don't see anything obvious on the developer list, so I suppose the feature is still pending? (I understand that any middleware will force the non-iterative behavior and am willing to live with that limitation.) Thanks, Steve Bergman --~--~-~--~~~---~--~~ 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: got unexpected keyword argument 'widget'
Never mind. Clearly, I was confusing my models with my forms. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
got unexpected keyword argument 'widget'
I have a model field that I want to change the attrs on when displayed by newforms. I thought I could do something like: class Timesheet(models.Model): date = DateField(widget=forms.TextInput()) and then define my attrs in the widget. But syncdb is complaining: TypeError: __init__() got an unexpected keyword argument 'widget' I'm just learning newforms. But the docs and the book seem pretty clear that what I'm doing should work. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
How do generic views determine for field sizes?
I have a model with several fields, one of which is defined like this: mi = CharField(max_length=1, blank=True) When I use it in a generic create_update form, it sets the size=30 and maxlength=1. This seems odd to me. I can override it with CSS. But why does it make the field so large in the first place? I'd like for it to size the field to fit what can go in it on its own. I'm using the latest from subversion. 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 -~--~~~~--~~--~--~---
Django on Nokia 770?
Does anyone have comments about the possibility of running a django server on the Nokia 770? Is it possible? I have a simple app that I want to demo on it with both the django server and the browser running on the same device. --~--~-~--~~~---~--~~ 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: Eroneous error with development server: 'module' object has no attribute 'urlpatterns'
Some additional info. I zapped my django installation and reinstalled from svn from scratch. I still had the problem. I tar'd up my project and moved it to a CentOS 5 box running 5631 and I do *not* experience the problem there. The two salient differences between the machines is that the problematic one is running CentOS 4.4/Python 2.3.4 and the CentOS 5.0 box is running Python 2.4.3 and also happens to be running X86_64. Could this be a Python 2.3.x issue? -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: Eroneous error with development server: 'module' object has no attribute 'urlpatterns'
This problem seems to occur whenever there is any syntax error in my code *anywhere*. I just introduced one about a hundred lines into my view function and triggered it. Here is a simple test case, complete with sample syntax error: === urls.py: from django.conf.urls.defaults import * from testproj.testapp.views import * urlpatterns = patterns('', (r'^testapp/$', hello), ) === === testapp/views.py: from django.shortcuts import render_to_response def hello(request): x = 5 x ++= 1 return render_to_response('hello.html') === === testapp/hello.html: hello Hello, Syntax Error! === --~--~-~--~~~---~--~~ 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: Eroneous error with development server: 'module' object has no attribute 'urlpatterns'
Apologies if I was not clear. Yes, I was expecting that if I had a syntax error in my code, the development server (./manage.py runserver) would either abort completely or restart itself. Instead, I see the error page directing me to the syntax error, which I fix, and then reload the page or try to load the main page. That's when I get the above output. I would prefer that the development server either restart itself or abort completely so that I could have a shell script restart it as necessary. Thanks, Steve P.S. It also occurs to me that I should have switched to cut and paste view before pasting into my original post. Sorry about that. --~--~-~--~~~---~--~~ 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: Eroneous error with development server: 'module' object has no attribute 'urlpatterns'
I'm still seeing this with 5631. It is definitely after I hit a syntax errror in my code that I see the behavior. I'm wondering if I am the only one seeing this. Or if is perhaps expected behavior. Thanks, Steve Bergman --~--~-~--~~~---~--~~ 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: Building forms by hands
On Jul 7, 9:48 am, Alexander Solovyov <[EMAIL PROTECTED]> wrote: > But my colleguaes, who are responsible > for HTML part, doesn't like django-generated forms - they want full > control. Yeah. Coworkers are a drag. ;-) You do know that you can place the fields yourself, right? If your form instance is called 'form' and has fields lastname and firstname, you can put something like: {{ form.lastname }},{{ form.firstname }} in your template and have full control over the way the form looks. You don't have to accept the default arrangement that Django gives by default. HTH, 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: Rendering a template to the browser on the fly using an iterator?
Thank you for the replies. I only searched the user list. Sounds like I should probably leave things as they are for now. The memory requirements are not *that* extreme. Iterative rendering would be super cool though. I write intranet *apps* rather than web *sites* and it seems I'm always dealing with large sets of data and big tables. With iterative rendering (and if the Firefox guys would fix the performance issues with large tables) I'd be happy as a clam. -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 -~--~~~~--~~--~--~---
Rendering a template to the browser on the fly using an iterator?
I am working on a report generator which needs to render potentially huge sets of data into an html table. The method that generates the rows is an iterator. I believe that if I do something like: return HttpResponse(my_iterator()) it will do what I want. Except that I want to do it with a template. I can do something like: return render_to_response('report.html', dict(output=generate_output())) and it works, but it does all the rendering before it starts sending to the browser, incurring the potentially large memory requirements of doing so. I'd like to be able to render a template straight down the wire to the browser on the fly. Is this possible? Thanks for any assistance, Steve Bergman --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Eroneous error with development server: 'module' object has no attribute 'urlpatterns'
I've been frequently encountering this problem. I'm on revision 5582 and using the development web server. Often, but not always, after I have some other error, my next request gets the error below, and I have to restart the server to get past it. I believe this happens after I run into a syntax error and fix it, but I'm not certain. I saw another post about this error which talked about old .pyc files being left in django_src, so I cleaned all those out. But the problem persists. Is this a bug that I need to file a ticket on? --- AttributeError at /reports/query/ 'module' object has no attribute 'urlpatterns' Request Method: GET Request URL:http://127.0.0.1:8000/reports/query/ Exception Type: AttributeError Exception Value:'module' object has no attribute 'urlpatterns' Exception Location: /usr/lib/python2.3/site-packages/django/core/ urlresolvers.py in resolve, line 220 Python Executable: /usr/bin/python Python Version: 2.3.4 Traceback (innermost last) Switch to copy-and-paste view * /usr/lib/python2.3/site-packages/django/core/handlers/base.py in get_response 61. return response 62. 63. # Get urlconf from request object, if available. Otherwise use default. 64. urlconf = getattr(request, "urlconf", settings.ROOT_URLCONF) 65. 66. resolver = urlresolvers.RegexURLResolver(r'^/', urlconf) 67. try: 68. callback, callback_args, callback_kwargs = resolver.resolve(request.path) ... 69. 70. # Apply view middleware 71. for middleware_method in self._view_middleware: 72. response = middleware_method(request, callback, callback_args, callback_kwargs) 73. if response: 74. return response ▶ Local vars Variable Value debug exceptions mail_admins middleware_method > request , POST:, COOKIES:{'sessionid': '23110c2aeaa9a0e03387647021ab7f98'}, META: {'COLORTERM': 'gnome-terminal', 'CONTENT_LENGTH': '', 'CONTENT_TYPE': 'text/plain', 'DBUS_SESSION_BUS_ADDRESS': 'unix:abstract=/tmp/dbus- p15nJMfAVj', 'DESKTOP_STARTUP_ID': '', 'DISPLAY': 'unix:1000.0', 'DJANGO_SETTINGS_MODULE': 'mgn.settings', 'GATEWAY_INTERFACE': 'CGI/ 1.1', 'GNOME_DESKTOP_SESSION_ID': 'Default', 'GNOME_KEYRING_SOCKET': '/ tmp/keyring-PZpbwV/socket', 'GTK_RC_FILES': '/etc/gtk/gtkrc:/home/ steve/.gtkrc-1.2-gnome2', 'G_BROKEN_FILENAMES': '1', 'HISTSIZE': '1000', 'HOME': '/home/steve', 'HOSTNAME': 'mgn.localdomain', 'HTTP_ACCEPT': 'text/xml,application/xml,application/xhtml+xml,text/ html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'en- us,en;q=0.5', 'HTTP_CONNECTION': 'keep-alive', 'HTTP_COOKIE': 'sessionid=23110c2aeaa9a0e03387647021ab7f98', 'HTTP_HOST': '127.0.0.1:8000', 'HTTP_KEEP_ALIVE': '300', 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4', 'INPUTRC': '/etc/inputrc', 'KDEDIR': '/usr', 'LANG': 'en_US', 'LESSOPEN': '|/usr/bin/lesspipe.sh %s', 'LOGNAME': 'steve', 'LS_COLORS': 'no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:', 'MAIL': '/var/spool/mail/steve', 'NXSESSIONID': 'mgn.localdomain-1000-63445E5A17FFFAB05FB69FA37CD6FCA5', 'OLDPWD': '/ home/steve/django', 'PATH': '/usr/kerberos/bin:/usr/local/bin:/bin:/ usr/bin:/usr/X11R6/bin:/home/steve/bin', 'PATH_INFO': '/reports/ query/', 'PWD': '/home/steve/django/mgn', 'QUERY_STRING': '', 'REMOTE_ADDR': '127.0.0.1', 'REMOTE_HOST': '', 'REQUEST_METHOD': 'GET', 'RUN_MAIN': 'true', 'SCRIPT_NAME': '', 'SERVER_NAME': 'localhost.localdomain', 'SERVER_PORT': '8000', 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'WSGIServer/0.1 Python/2.3.4', 'SESSION_MANAGER': 'local/mgn.localdomain:/tmp/.ICE-unix/11807', 'SHELL': '/bin/bash', 'SHLVL': '3', 'SSH_AGENT_PID': '11819', 'SSH_ASKPASS': '/usr/libexec/openssh/gnome-ssh-askpass', 'SSH_AUTH_SOCK': '/tmp/ssh-pYgtE11807/agent.11807', 'SSH_CLIENT': ':::127.0.0.1 37967 22', 'SSH_CONNECTION': ':::127.0.0.1 37967 :::127.0.0.1 22', 'TERM': 'xterm', 'TZ': 'America/Chicago', 'USER': 'steve', 'WINDOWID': '29360207', '_': './manage.py', 'wsgi.errors': ', mode 'w' at 0xb7f270a0>, 'wsgi.file_wrapper': , 'wsgi.input': , 'wsgi.multiprocess': False, 'wsgi.multithread': True, 'wsgi.run_once': False, 'wsgi.url_scheme': 'http', 'wsgi.version': (1, 0)}> resolver response None self settings urlconf 'mgn.urls' u
Re: Instantiate model object with dictionary?
> Probably best to give a (short) code example showing how you are trying > to do this. Creating a model as MyModel(**some_dict) works, since that > is exactly the same as explicitly passing in keyword arguments, so maybe > you are doing something odd somewhere else. Thank you. I was trying to do: m = MyModel(my_dict) instead of m = MyModel(**my_dict) Works now. :-) -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 -~--~~~~--~~--~--~---
Django facility for storing a SelectMultiple list to postgresql array?
Is there any facility in Django which takes advantage of postgresql's support of arrays? I'd like to be able to store the list returned by a SelectMultiple to an array of strings. Currently, I am converting the list to comma separated values to store in the database, but it would be nice to store it in some sort of MultiCharField which takes a list. 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 -~--~~~~--~~--~--~---
Instantiate model object with dictionary?
I'm a bit confused about the right way to get data from a form to a model. I'm working with a model and form for which I don't want to use form_for_model, so I am defining a newform manually. Once the form is validated, I want to pass form.cleaned_data to instantiate the model object and then save it. But I end up with an empty object. Do I really have to set the attributes individually? Or is there a more concise way to do it? Thanks, Steve Bergman --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Spicify form field choices at form instantiation?
My understanding is that the best way to have the choices in a choice field to update dynamically is to subclass form and override __init__(). Is this still the case? I'm coming from TurboGears, which has a very similar form/widget/ validation system. But one nice feature in TG is that you can pass an "options" dictionary when instantiating a form, in which the key is the field in the form and the value is a list of tuples specifying the current options for that field. Would this be a good idea for Django newforms? It seems a common enough need. e.g. right now I have a ChoiceField on one form in which the user selects a location, and when they submit that it needs to bring up another form with another choice field whose options depend upon the location. -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: Which ajax framework django will support in the upcoming 1.0, prototype/dojo/jquery?
To me, that does not seem very DRY. Even after the developer decides upon a javascript library to use, there is still a lot of boilerplate involved to do common things like populating one widget based upon what the user selects in another widget. I often need to populate one widget based upon what the user selects in another. Or update the contents of one div without reloading the whole page. And, OK, I'll fess up and say that I want to think in python and not have to switch gears back and forth between python and javascript. ;-) Integration of a javascript library with the new widgets and forms would have a lot of advantages. I'm new here. So I don't want to be overly critical. But Django definitely has a preferred ORM and a preferred templating engine. Why be so set on complete agnosticism when it comes to javascript? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---