Re: How can I apply ordering through a M2M join model?

2010-02-28 Thread Kyle Fox
is wrong with gallery.photos.all().order_by('name') ? > > On Feb 27, 4:49 pm, Kyle Fox wrote: > > > > > I'm wondering if it's possible to apply ordering to a ManyToMany > > relationship by using a `position` attribute on the join model.  A > > cla

How can I apply ordering through a M2M join model?

2010-02-27 Thread Kyle Fox
I'm wondering if it's possible to apply ordering to a ManyToMany relationship by using a `position` attribute on the join model. A classic example (photo gallery) is probably the best way to illustrate this: class Photo(models.Model): image = models.ImageField(upload_to="photos") class Galle

Re: wordpress hooks and actions system in django?

2008-02-22 Thread Kyle Fox
The part that I'm struggling to wrap my head around is how to make plugins "installable". I think one of the reasons Wordpress's plugin framework is so successful is how easy it is to manage your plugins: install / uninstall buttons on a page means the user doesn't have to write any glue code or

Re: In need of a more flexible URL routing scheme...

2008-02-04 Thread Kyle Fox
Okay, I think I did something like that. The problem is that the @permalink and named urls doesn't seem to work because the named URL has two different entries in the URLconf... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Googl

In need of a more flexible URL routing scheme...

2008-02-03 Thread Kyle Fox
I've been having a hard time figuring out how to solve this problem: We're building *another* django blogging app, but we want the app to support multiple blogs on the same site, ideally by having each Blog "mounted" on it's own URL, ie: "/politics/" is a Blog, "/tumbles/" is another Blog, etc.

Re: Having a problem using django-admin.py runserver

2007-12-03 Thread Kyle Fox
I'd just like to report that we're having this problem as well, the same as you describe. The `shell` command seems to work fine... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to thi

Re: Design Question : model needs in model or view

2007-11-07 Thread Kyle Fox
I'd probably put it in the model. Putting it in the view means if you ever create an instance of that model elsewhere, you'll need to duplicate the code for creating the related model. Not very DRY :) --~--~-~--~~~---~--~~ You received this message because you a

How to use SplitDateTimeWidget (getting TypeError)

2007-09-25 Thread Kyle Fox
I'm trying to use a SplitDateTimeWidget for a forms.DateTimeField field, but keep getting TypeError: "expected string or buffer" The traceback leads to `strptime.py`, which has `found = format_regex.match(data_string) `. The local variables are: data_string = [u'2007-09-29', u'11:05:59.898833']

Re: Django deployment à lá Capistrano

2007-09-12 Thread Kyle Fox
I really don't see a need for a huge project to accomplish the goals you've outlined: 0) Checking in the local source changes if they have not already been checked in (optional). 1) Logging into the deployment target. 2) Checking out the latest source. 3) Modifying the production database as nece

Re: Including view in a template

2007-08-02 Thread Kyle Fox
You might want to try writing an inclusion tag: http://www.djangoproject.com/documentation/templates_python/#inclusion-tags They are much simpler to write than template tags, and more "designer friendly." They let you write a separate template that gets rendered inside of another template (simil

Re: Blog engine

2007-07-18 Thread Kyle Fox
It's easy to write a "basic" blog in Django. If that's all people want, then great. Something like that will work perfectly for the majority of bloggers (who probably won't get that much readership anyway)... But all this talk about making a "full-featured" blog app in Django -- one that will r

Developing a flexible CMS

2007-06-24 Thread Kyle Fox
I hope I can explain this well, because I've been wracking my poor little brain trying to figure out how to do this :) I'm trying to create a flexible CMS. I want it to be easy for users to create a Page, and attach all kinds of content ("components") to that page. These components would all be

Re: Moving Images to Amazon S3

2007-06-01 Thread Kyle Fox
SanPy, Thank you! This works awesome and does exactly what I need! --~--~-~--~~~---~--~~ 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 unsubs

Re: Moving Images to Amazon S3

2007-05-31 Thread Kyle Fox
I think my question wasn't clear: we're having NO problem putting files on S3, that's dead simple (ie what Holovaty blogged about). What we need to do is take an *in-memory Image* and put it directly onto S3. We need a way to convert a PIL Image instance into a format S3 can accept WITHOUT havi

Moving Images to Amazon S3

2007-05-30 Thread Kyle Fox
I'm absolutely stuck on this. This question might be more python than django related, but I figured because it deals with Amazon S3, someone here may know how to handle it. Here's what needs to happen: 1. A user uploads an image (part of a Model we have) 2. Create a 100x100 thumbnail using PIL

Re: Where did you put your homepage view?

2007-05-23 Thread Kyle Fox
> I usually make a home controller. Then I typically use an index > action for the home page view. This is normally what I do as well, I just define a view called 'index' somewhere and point r'^$' at it. But this seems like a good place for me to ask a related question I've often puzzled over:

Re: Where did you put your homepage view?

2007-05-23 Thread Kyle Fox
> I usually make a home controller. Then I typically use an index > action for the home page view. This is normally what I do as well, I just define a view called 'index' somewhere and point r'^$' at it. But this seems like a good place for me to ask a related question I've often puzzled over:

Re: Where did you put your homepage view?

2007-05-23 Thread Kyle Fox
> I usually make a home controller. Then I typically use an index > action for the home page view. This is normally what I do as well, I just define a view called 'index' somewhere and point r'^$' at it. But this seems like a good place for me to ask a related question I've often puzzled over:

Re: Where did you put your homepage view?

2007-05-23 Thread Kyle Fox
> I usually make a home controller. Then I typically use an index > action for the home page view. This is normally what I do as well, I just define a view called 'index' somewhere and point r'^$' at it. But this seems like a good place for me to ask a related question I've often puzzled over:

Re: Securing static files

2007-05-19 Thread Kyle Fox
Maybe I'm not understanding what the problem is, but why can't you just make a new directory for each user? > > user A uploads file 1 to /static_files//file1.jpg --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dja

Re: Need some help with Amazon S3

2007-05-07 Thread Kyle Fox
1) We found S3 to be a bit slow, both upstream and down. Upstream is slow largely because of the SOAP overhead (from what I understand), and we were sending lots of data (about 5 resized images for each image uploaded to django). Downstream, well, not much you can do about that, regardless of h

Re: Simple model inheritance

2007-04-01 Thread Kyle Fox
> Django's model inheritance will have an attribute to indicate that the > base class is an abstract base, just as you are asking about. Do you mean this feature isn't yet in django? I haven't found anything on the docs about this (I could really use it too!) If it's in the trunk, do you know w

Re: DB Super Model (ahem)

2007-03-27 Thread Kyle Fox
This is just a guess, but could it be because you're calling .save() (defined in models.Model) before calling __init__() on the superclass? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To po

Re: Suggestions for Django Presentation

2007-03-21 Thread Kyle Fox
Filters are unbelievably helpful when you have different people doing markup and development. The 'pluralize' filter, for example (as well as the 'humanize' collection), has saved us developers from having to write templae-side code to figure out if there should be an 's' at the end of a noun. Th