|
A note about the OP, you define __str__ in your models, however when you query the db using the api it's attributes are unicode, which I believe means you are using svn, and therefore you should have defined __unicode__ instead, let me know if I'm wrong, either way: yay django, and use trunk
|
# ¿ Mar 6, 2008 00:58 |
|
|
# ¿ Apr 29, 2024 09:23 |
|
You can also use select_related() to be more efficient(for example if you have an Entry model that is fkeyed to a Category model, you can use this to get the categories with the entries, that way you won't have an extra query whenever you access the category attr on the entry).
|
# ¿ Mar 7, 2008 16:13 |
|
ATLbeer posted:I'm going to be at PyCon next week. If I run into any of the Django guys I'll mention it because I want a shirt that looks decent too. See you there! Are you sprinting?
|
# ¿ Mar 7, 2008 23:34 |
|
Who is your shard host? Most of them have their own specific instructions. This thread: http://groups.google.com/group/django-users/browse_thread/thread/68c21aab73d212ff has some good info for the various shared hosts.
|
# ¿ Mar 9, 2008 23:24 |
|
Neurozys posted:I'm still just getting my toes wet with web programming, but it looks like Ruby on Rails has some nice shortcuts for using Prototype and script.aculo.us. I've read the B-List articles about doing AJAX with Django from back in fall of '06, but it seems relatively complex. Are there any shortcuts for integrating all that 'Web 2.0' jazz on Django these days, or is it still a mostly manual process requiring a fair amount of javascript coding? Yes, Django won't write your javascript, it also doesn't lock you into using a specific toolkit, so you can use YUI, Dojo, jQuery, whatever.
|
# ¿ Mar 11, 2008 02:53 |
|
If you want something similar to Rails' migrations, check out django-evolution: http://code.google.com/p/django-evolution/
|
# ¿ Mar 11, 2008 20:22 |
|
For anyone who's interested I've been working on building a plugin system for django. It's still a work in progress, but it should work. You can check it out here: http://github.com/alex/django-plugins/tree/master
|
# ¿ Mar 11, 2008 23:56 |
|
There shouldn't be a question mark after the '/' in admin.
|
# ¿ Mar 12, 2008 05:17 |
|
Take 50 out of quotes, I'm pretty sure it is try to do this int(str("50")).
|
# ¿ Mar 12, 2008 18:27 |
|
ATLbeer posted:I dunno if you posted in the right thread or not but, I'm a bit confused at what your trying to do there ashgromnies edited his post :P . My post isn't clear, I meant str("\"50\"")
|
# ¿ Mar 12, 2008 19:08 |
|
Addict posted:It looks like I may have a project coming up that deals with Ajax. Not like a metric ton of ajax, but a pretty fair amount. Mostly visual/organization related. Is django solid enough with ajax to still use it, or do I need to consider doing it on rails. Django has support for many different serializes(JSON, XML, etc.), there is no reason you couldn't use it, on the other hand, it won't right your javascript for you.
|
# ¿ Mar 22, 2008 21:35 |
|
You seem to be willfully ignoring the fact that this is python, you can write code, if you have to do a task several times write a function, use a loop!
|
# ¿ Mar 25, 2008 20:23 |
|
You can consult this page: http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges to see any backwards incompatible changes since .96.
|
# ¿ Mar 29, 2008 18:43 |
|
jarito posted:I have a quick question about master templates and such. I have one master template that works fine, but I was curious how to handle dynamic data in the different blocks. Let's say I have something like this for the master template (lots of the basic code omitted). You can actually do this logic in the master template(assuming you want it in all child templates): code:
You will need to have RequestContext for this to work(of course).
|
# ¿ Apr 14, 2008 00:32 |
|
deimos posted:generally speaking you don't want nulls in tables, it does funky stuff with some queries and generally acts weird depending on implementation. Not for much longer! On This Week in Django(great podcast), Malcom Tredinick(core commiter), said queryset-refactor will be getting merged sometime this week/next week, that branch fixes tons of SQL construction issues(including NULLS, joins, and about a billion other things).
|
# ¿ Apr 23, 2008 07:50 |
|
And queryset-refactor just hit trunk: http://code.djangoproject.com/changeset/7477 YAY!
|
# ¿ Apr 27, 2008 04:24 |
|
If you want schema migration I would check out django-evolution(on google code).
|
# ¿ May 6, 2008 19:37 |
|
ATLbeer posted:I had the same reaction when I started using Django myself. I found myself implementing something that was already built into Django. This is no longer the correct way to do it actually, if you are using SVN you should use ModelForms.
|
# ¿ May 9, 2008 18:03 |
|
FrontLine posted:Can somebody post an example of how to use the validators mentioned at the bottom of http://www.djangoproject.com/documentation/forms/ Don't use that, you should be using newforms. And also, for everyone using pretty much any version of django there is a security update to fix an XSS issue in the Admin, more info on the django blog.
|
# ¿ May 14, 2008 06:49 |
|
I'd usually do that in the __init__ method, rather than in the view. [code] class SampleForm(forms.Form): field = forms.ModelChoiceField(queryset=Model.objects.none()) def __init__(self, *args, **kwargs): user = kwargs.pop('user') super(SampleForm, self).__init__(*args, **kwargs) self.fields['field'].queryset = Model.objects.filter(owner=user)
|
# ¿ May 14, 2008 21:02 |
|
I'd usually do that in the __init__ method, rather than in the view. for example: code:
|
# ¿ May 14, 2008 21:02 |
|
It's not documented because it's considered internals, my guess is it's that way because sometimes DRY and explicit bump heads.
|
# ¿ May 17, 2008 21:54 |
|
This query will probably be pretty slow but what you can do is:code:
|
# ¿ May 24, 2008 19:00 |
|
As some of you may know, Django Dash(http://www.djangodash.com/) will be occuring next weekend, and registration ends today. Is there anyone who would be interested in working on something with me. I have no idea for a project(or at least no original ones :P). If you are interested either let me know here, or message me in the #django channel on freenode IRC(my name is the only one that starts with Alex_ in the channel).
|
# ¿ May 25, 2008 01:47 |
|
Checkout django-wikiapp it keep revisions for all the articles, theres also django-rcsfield.
|
# ¿ May 30, 2008 23:32 |
|
Checkout django-wikiapp it keep revisions for all the articles, theres also django-rcsfield.
|
# ¿ May 30, 2008 23:32 |
|
Checkout django-wikiapp it keep revisions for all the articles, theres also django-rcsfield.
|
# ¿ May 30, 2008 23:32 |
|
Correct, select_related() only goes forward at present, there was some discussion a while ago about having it work backwards as well, and malcolm said he would probably look at it, and that it was doable.
|
# ¿ May 31, 2008 05:39 |
|
Correct, select_related() only goes forward at present, there was some discussion a while ago about having it work backwards as well, and malcolm said he would probably look at it, and that it was doable.
|
# ¿ May 31, 2008 05:39 |
|
You can still do backwards relations: http://www.djangoproject.com/documentation/db-api/#backward you just can't use select_related to prefect them
|
# ¿ May 31, 2008 07:39 |
|
Yes, someone could attack you by uploading a huge image(it will get read into memory), check out ticket #2070.
|
# ¿ Jun 2, 2008 19:57 |
|
You are putting a form field on a model.
|
# ¿ Jun 3, 2008 18:22 |
|
chocojosh posted:1) Is Django an appropriate tool? 1) Yes 2) Probably, I don't know much about rails 3) You'll learn quickly enough 4) Not terribly long 5) Maybe, if it's shared hosting you might have a problem, check out http://djangofriendly.com/hosts/ for hosting reviews 6) Go use satchmo: http://www.satchmoproject.com/
|
# ¿ Jun 26, 2008 20:36 |
|
Bonus posted:1.0 is supposed to come out on September the 2nd. Read more about the schedule here There's also this nice wiki page: http://code.djangoproject.com/wiki/VersionOneRoadmap
|
# ¿ Jul 6, 2008 00:52 |
|
ATLbeer posted:Followed by rewriting all your models.py files :\ There's a snippet on djangosnippets that tries to automate creating the new admin.py files.
|
# ¿ Jul 19, 2008 08:27 |
|
Here's the inline stuff: http://www.djangoproject.com/documentation/admin/#inlinemodeladmin-objects
|
# ¿ Jul 28, 2008 03:05 |
|
And ticket 5361 just hit, this allows for using alternate file system backends, yay!
|
# ¿ Aug 8, 2008 22:41 |
|
If anyone is interested I have a django application(open source, BSD license) for doing ajax validation for your forms(ie, you have a form and want to be able to validate in over ajax using the form classes you already created in python). You can check it out at http://github.com/alex/django-ajax-validation/tree/master if you use git or http://code.google.com/p/django-ajax-validation/ if you use SVN.
|
# ¿ Aug 12, 2008 07:01 |
|
new docs stuff just hit django, you can check out the hotness at http://docs.djangoproject.com/
|
# ¿ Aug 24, 2008 00:03 |
|
|
# ¿ Apr 29, 2024 09:23 |
|
mwarkentin posted:Thought I'd bump this for RC1! http://www.djangoproject.com/weblog/2008/sep/02/10-rc1/ I don't know about the pros and cons of each but satchmo(django store app)(satchmoproject.com) has a ton of support for various gateways built in, so you can probably steal code from them for whatever you are working on.
|
# ¿ Sep 3, 2008 04:18 |