Get times of day with most entries

2008-09-15 Thread Henrik Lied
y of doing this? Thanks! Henrik Lied. --~--~-~--~~~---~--~~ 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

Sending user submitted data through HTTP POST to another resource

2007-09-23 Thread Henrik Lied
Hi there! I'm working on a project where users can upload videos to a service. The project is written in Django, but the videos and transcoding of these is handled by a remote server in our media corporation. The API for uploading to this server only accepts HTTP POST, and this is where I'm a

Re: Accessing the content-attribute in request.FILES without loading it into memory

2007-08-14 Thread Henrik Lied
bucket, but it shouldn't be too hard to hack the patch from the > ticket. > > [1]http://code.djangoproject.com/ticket/2070 > > regards, > Simon > > On Aug 14, 3:10 am, Henrik Lied <[EMAIL PROTECTED]> wrote: > > > Hi there! > > > I'm using Amazon S3 for f

Accessing the content-attribute in request.FILES without loading it into memory

2007-08-13 Thread Henrik Lied
Hi there! I'm using Amazon S3 for file storage, and I have to send the file directly from request.FILES. (I could always save the file locally first, send it to Amazon and then delete it from my local server, but this would double the wait for the user.) Is there a way to only load chunks of

Re: Blog engine

2007-07-29 Thread Henrik Lied
@Forest: I agree, it should be that simple. But let's say you've got a comment reply plugin. How would we - through a middleware - manage to intercept our usual comment system, and modify the HTML template source to fit the plugin? It's cases like these I see the potential pitfalls of our way of

Re: Blog engine

2007-07-28 Thread Henrik Lied
Ok, so I've been thinking some more. The model could be something like this: class Plugin(models.Model): """(Plugin description)""" pointer = models.FilePathField() ## Could work, right? name = models.CharField(maxlength=200) description = models.TextField(blank=True, null=True)

Re: Blog engine

2007-07-28 Thread Henrik Lied
When you say "installs", do you mean that the plugin is retrieved from the external site, and placed somewhere on the users host, or is it constantly querying the plugin on a remote computer? The first of those two options would definitely be the best. But I'm having some problems working it out

Re: Blog engine

2007-07-27 Thread Henrik Lied
This is great, Chris, but the fact of the matter is that it won't appeal to the "Wordpress crowd". That group wants in-browser setup, easy plugin architecture etc. contrib.admin wouldn't do the trick. The admin-panel would have to be hand made. For the plugin architecture: I have no idea how

Re: Blog engine

2007-07-24 Thread Henrik Lied
This sounds great. I created a project on Google Code: http://code.google.com/p/django-blog-engine/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Abstracting the low level API

2007-07-06 Thread Henrik Lied
Hi there! The cache middleware didn't quite suit my needs, so I threw up a small function to reset the cache key whenever the object is updated. The functions look like this: http://dpaste.com/hold/13712/ Sample usage would be >>> entry = cache_key(request, 'blog', Entry.objects.get(id=1))

Re: Event based caching

2007-06-10 Thread Henrik Lied
So there's simply no way around this? If I'm sticking with the time based cache, it will probably only be activated for non-authorized users. The problem is that most of the site is restricted to logged in users, so the server load will probably be a bit too high. Has this subject never been

Event based caching

2007-06-09 Thread Henrik Lied
Hi there! I haven't found anything on this, so I thought I'd ask: Has anyone implemented event-based caching in Django? Hypothetical scenario --- A rather large social networking site uses memcached for caching. The Django Caching Framework only allows time-based

Editing seveal object in one page

2007-05-12 Thread Henrik Lied
Hello! Ok, this is the scenario: An album contains several images. The user can click on "manage album", and get a list of all the images contained inside the specific album. The user should then be able to edit information on each individual image on one page, and click a "Submit"-button at the

Re: Example of passing initial value to SelectDateWidget?

2007-04-29 Thread Henrik Lied
> > > Is anyone able to provide an example of passing initial data to the > > > SelectDateWidget in newforms.extras.widgets (or to the DateField that > > > uses that widget)? I've tried many different approaches, but am > > > totally stuck. This won't work? birthdate =

Re: Friendship_type on symmetrical M2M

2007-04-28 Thread Henrik Lied
Thanks for the quick reply! On 29 Apr, 02:02, Tim Chase <[EMAIL PROTECTED]> wrote: > This also meets your criterion that, X can consider Y a friend, > but Y doesn't have to consider X a friend. I'm sorry, maybe I haven't been clear enough on what I want to achieve. This little problem is part of

Re: Friendship_type on symmetrical M2M

2007-04-28 Thread Henrik Lied
't include Joe in the output in Murray's case. Catch my drift? It doesn't seem to be dynamic enough, if you understand what I mean. On 29 Apr, 01:49, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sat, 2007-04-28 at 23:27 +, Henrik Lied wrote: > > Thank you for your ex

Re: Friendship_type on symmetrical M2M

2007-04-28 Thread Henrik Lied
Thank you for your example, Tim. I'm sorry, but the problem with it is that it isn't symmetrical. A part of my Profile-model looks like this: class Profile(models.Model): user = models.ForeignKey(User) friends = models.ManyToManyField("self") This makes it very easy to create and

Friendship_type on symmetrical M2M

2007-04-28 Thread Henrik Lied
Hi there! Scenario: User A goes to User B's profile. User A know User B, so User A adds User B as his friend. He then specifies their friendship as "Colleagues". How can I make this work? I have extended the User-model to include a friends-field (ManyToManyField("self")), but I have no idea how

"News Feed" feature

2007-04-23 Thread Henrik Lied
Hi there, What would you say is the best way to implement a "news feed" feature, like the one in Facebook? Right now I have a model (ActivityMonitor) with fields for actions, paths and users. But I feel this method might not be scalable enough. I print the entire action into the database ("User

Re: DateField returns 'str' object has no attribute 'strftime'

2007-04-20 Thread Henrik Lied
Hi Malcolm, I just figured it out - with some help in the IRC-channel. I passed the form variables through datetime.date. That did the trick. Thanks for your reply! On 20 Apr, 11:44, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Fri, 2007-04-20 at 09:09 +0000, Henrik Lied wrot

DateField returns 'str' object has no attribute 'strftime'

2007-04-20 Thread Henrik Lied
Hi there, I'm creating a user registration system for a project. The system uses the SelectDateWidget for user input of birthdate. When I try to register a new user, the system spits back this error: 'str' object has no attribute 'strftime' This is the relevant code: bd_month =

Re: ANN: Upcoming backwards-incompatible changes to Django development version

2007-04-06 Thread Henrik Lied
Yeah, you're right about that. Your example works best with editable=False, I'd say. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Smartest way to display help messages per view

2007-04-06 Thread Henrik Lied
I'm not quite sure what I'd to, either. Giving the help info its own model might be good in some way, but it might be a bit overkill. Totally depends on your application. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: ANN: Upcoming backwards-incompatible changes to Django development version

2007-04-06 Thread Henrik Lied
> Examples of some of these changes are: > > * Removing the "auto_now" and "auto_now_add" options in Django models. > Is this removed without a substitute? > * Removing the LazyDate shortcut. > Again, is this removed without a substitute? --~--~-~--~~~---~--~~

Starting a new, external process

2007-03-14 Thread Henrik Lied
Hi there! I have a model which allows people to upload videos. In the save-method I run os.system("mencoder *variables"), which converts the uploaded video to a flash file. I don't want the user to have to wait until the conversion is done before he can go on with his business. I've tried the

Re: Video uploading and converting - queue system?

2007-03-08 Thread Henrik Lied
The thing is that the server load will increase quite a bit when 500 users do the same thing at the same time. It would be nice to get a different server to take care of this. How's that "large streaming upload" patch working? --~--~-~--~~~---~--~~ You received

Video uploading and converting - queue system?

2007-03-07 Thread Henrik Lied
Hi there, I'm creating a video upload feature for a social network. The uploaded video gets converted to Flash Video (flv) using mencoder. I need some input on how to convert the video. As it is now, I'm just converting the file directly after the original file is saved (via os.system). The

Re: How to implement a group-feature in a social network app?

2007-03-04 Thread Henrik Lied
For example: Joe creates a group called 'Fruitlovers'. Then he wants Chris and Peter to be able to moderate the group. What would be the ideal GUI- presentation for the creator? And how would a view like that look like? --~--~-~--~~~---~--~~ You received this

Re: How to implement a group-feature in a social network app?

2007-03-04 Thread Henrik Lied
Hi there, That's actually true, I've changed that to a M2M now. Thanks! :-) Any other suggestions? Does anyone know of any articles/texts on this subject? -- Henrik. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

How to implement a group-feature in a social network app?

2007-03-04 Thread Henrik Lied
feedback on how it's done properly? :-) Cheers from Norway, Henrik Lied --~--~-~--~~~---~--~~ 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@google

Re: Template filter to retrieve the MEDIA_URL

2007-03-02 Thread Henrik Lied
Hi there, Sean! Thanks for the different methods -- I went for a different approach, though. I simply created a simple filter like this: def mediaurl(value): import re from project.setting import MEDIA_URL "Replaces the string MEDIAURL with the MEDIA_URL" return

Re: how to user generic views (object_list) to show dynamic list ?

2007-03-02 Thread Henrik Lied
Yeah, just pass an extra argument in the urls.py, like /files/(? P[-\w]+), and filter your queryset. Take a look at http://www.b-list.org/weblog/2006/11/16/django-tips-get-most-out-generic-views --~--~-~--~~~---~--~~ You received this message because you are

Template filter to retrieve the MEDIA_URL

2007-03-02 Thread Henrik Lied
Hi there, I'm just wondering what the best way of retrieving the MEDIA_URL for an object is. Let's say I'm writing a blog post with some images. Instead of writing http://media.mydomain.com/image.gif;>, I'd write or something equivalent. So if I change my domain, I wouldn't have to rewrite a

Re: Need input on how to create a good tagging feature

2007-02-26 Thread Henrik Lied
Ah, GREAT! Just what I needed :-) One question though - if I wanted not only to split the tags when space separated, but also on "," and ", " - how would I do that? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Need input on how to create a good tagging feature

2007-02-26 Thread Henrik Lied
Hi there! I'm currently creating a new social networking site, specific for my country. One of the things on the feature-list is that each profile can create blogs (several, if the user wants to), and with blogging, tags become the natural alternative. So - I'd like some input on what you think

Inserting dummy content

2007-02-09 Thread Henrik Lied
Hi there! I was wondering if there's an easy way to insert a lot of dummy content into a couple of models. Have anyone written something that does this? The reason I'm asking is that I'm writing this social networking app, and in a while I'm going to present it to a company. It would be nice to

Trouble with relations

2007-02-09 Thread Henrik Lied
Hi there! I'm currently working on a project which mixes user generated content with journalistic content. The system lets users vote on an article, and articles with many positive votes will come up in the admin-panel, so that the moderators can label the entry for front page status. class