How to store user

2009-07-14 Thread Viktor Semykin
Hi everyone. I use django.views.generic.create_update.create_object to allow users to post new entries on my site. How can I make model automatically save the user currently logged in? Model like class MyModel(Model): user = ForeignKey(User) --~--~-~--~~~---~--~---

Re: Automatic slugs

2009-07-09 Thread Viktor Semykin
It did the job. Thanks! On Jul 9, 3:51 pm, Jonathan Buchanan wrote: > 2009/7/9 Viktor Semykin : > > > > > Hi everyone. > > > I'm trying to generate slugs automatically and disallow user to > > interfere with this. I think way to go is something like: &

Re: parsing urls with dot

2009-07-09 Thread Viktor Semykin
Why not to add dots to your regexp? For example, [\w\d\-\.]+ ? On Jul 9, 3:36 pm, Dids wrote: > Hi, > > I'm struggling to get the regex right in my urls.py file to match a > url with a dot inside it. (think ip address). > > for exmaple : >          http://servername/Url.With.Dot > > I'm not even

Automatic slugs

2009-07-09 Thread Viktor Semykin
Hi everyone. I'm trying to generate slugs automatically and disallow user to interfere with this. I think way to go is something like: class Entry(Model): title=CharField(max_length=100) slug=SlugField(default=slugify(...title...)) but I have no idea how to pass title field (or at lea

Re: Complex select

2009-07-07 Thread Viktor Semykin
Tim Chase wrote: > but Django lets you drop to raw SQL pretty easily, > so it shouldn't be a big deal. Thanks. I think I will stop on raw SQL. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Complex select

2009-07-07 Thread Viktor Semykin
Hi everyone. I'm trying to create comment overview page. I want to select all content entries that were recently commented. The problem is that I don't know how to do that. In SQL I would run something like select distinct object_pk from (select * from django_comments order by submit_date desc)