Re: model permission assignment via groups requires further config at model level?

2018-04-30 Thread Rob B
Thanks George - I understand now.  I never thought it would only apply to
the admin interface but should have.  Kind regards,

Rob


On Sun, Apr 29, 2018, 10:05 PM George Lubaretsi, 
wrote:

> Django permissions are only enforced in Admin interface by default. You
> have to enforce them in your views by using `has_perm` method of `user`
> instance - `user.has_perm('.')`
>
> Here's the documentation for permissions -
> https://docs.djangoproject.com/en/dev/topics/auth/default/#permissions-and-authorization
>
> Also, take a look at this blog post for some alternatives to built-in
> permissions system -
> https://www.vinta.com.br/blog/2016/controlling-access-a-django-permission-apps-comparison/
>
> On Monday, April 30, 2018 at 5:04:04 AM UTC+4, rsbaxter wrote:
>>
>> I'm trying to confirm if this is correct: I create a group with no
>> permissions in it, and assign this group to a user.  This user is not
>> "staff status" nor is the user "superuser status" - they are only active.
>> The user is not a member of any other groups - just the one with no
>> permissions.  Upon login, this user is still able to add, update and delete
>> all models in the app.  I think I'm misunderstanding the group
>> functionality - is it correct that permissions assigned via groups are not
>> automatically enforced by django and that further configuration is required
>> to enforce the permissions assigned via the group(s) assigned to the user?
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/2c0bd344-cc7b-4691-9a73-4bd39ff7c538%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALFpZ6P%2BMS8zgMBmWypKKpFXo1zatsJvYJ4g%2B2ES3gzhE0o96g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


form model def save question

2010-09-06 Thread Rob B (uk)
Been struggling over at 
http://stackoverflow.com/questions/3652585/simple-django-form-model-save-question
to get a solution.

I want the inuse field to update to to True when LocationForm is
saved.  For example there would be a list of locations added by the
admin (London, New York and Paris) all with inuse of False.  The user
would select London and submit the form and the inuse field for London
would become True.

Models and forms:

class Location(models.Model):
place = models.CharField(max_length=100)
inuse = models.BooleanField()
class Meta:
ordering = ('place', 'id')

def __unicode__(self):
return self.place

class LocationForm(ModelForm):
class Meta:
model = Location

class Booking(models.Model):
name = models.CharField(max_length=100, verbose_name="Your
name*:")
place = models.ManyToManyField(Location, blank=True, null=True)

def __unicode__(self):
return self.name

class BookingForm(ModelForm):

class Meta:
model = Booking

def save(self, commit=True):
booking = super(BookingForm, self).save(commit=False)
if commit:
booking.save()
for location in booking.place.all():
location.inuse = True
location.save()


Code saves fine but the location.inuse field is not saved to True.
Any ideas where I'm going wrong?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.



Best intranet solution for a small digital agency?

2010-06-07 Thread Rob B (uk)
I work for a small digital agency (10-15 employees).  We design and
build websites (using php and Django).  Are we better off building our
own intranet using django or going for a pre built (free or paid for)
solution?

Key features needed:

 - Project management (basecamp clone)
 - Time reporting
 - Local and external file sharing (dropbox clone)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.



Django or CMS.

2010-02-05 Thread Rob B (uk)
The design agency I work for are looking into CMS options.  Being a
Django man myself I'm hoping to convince them to build one using
Django.

Requirements are roughly:

Page control (creation/drafts/published/withdrawn/deletion)
Page revisions
View draft pages on site for testing
In-place editing for simple text updates
Categories
Editable Navigation
Wysiwyg editors
Image upload (mass select)
Tagging (pages, images, clients)
Smart site search
Limiting user publishing rights

I can't seem to find a decent CMS that would fit the criteria.  What
are people's opinions / experiences with CMS'?  What would you
recommend?  Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.



models.Manager error

2009-09-21 Thread Rob B (uk)

Model: http://dpaste.com/96349/

View:
def game_list(request):
return render_to_response('games/game_list.html',
  { 'object_list':
GameList.objects.published.all().order_by('position')})


Template error:
AttributeError at /games/
'Manager' object has no attribute 'published'

Would seem my view doesn't like my new manager very much?
--~--~-~--~~~---~--~~
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: date range headache

2009-09-07 Thread Rob B (uk)

Oh that just makes my brain hurt lol

Works though!  thanks

On Sep 7, 3:13 pm, Masklinn <maskl...@masklinn.net> wrote:
> On 7 Sep 2009, at 15:50 , Rob B (uk) wrote:http://dpaste.com/90621/
>
> > (The code in above obviously isn't going to work I'm just using it to
> > help illustrate my problem.)
>
> > I want to show all active promotions between the start date and end
> > date.
> > So if a promotion starts on 01/01/09 and ends 30/01/09 and a person
> > searches from 01/12/08 to 01/02/09 it will still return a result. Also
> > if they search from inside the date range e.g. 02/01/09 - 03/01/09
> > they would get the same result.
>
> > Is there some magical django way of achieving this without looping
> > over each day?
>
> Something along the lines of:
>
>      Promotion.objects.filter(start_date__lt=end_date,  
> end_date__gt=start_date)
>
> I'd think.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



date range headache

2009-09-07 Thread Rob B (uk)

http://dpaste.com/90621/
(The code in above obviously isn't going to work I'm just using it to
help illustrate my problem.)

I want to show all active promotions between the start date and end
date.
So if a promotion starts on 01/01/09 and ends 30/01/09 and a person
searches from 01/12/08 to 01/02/09 it will still return a result. Also
if they search from inside the date range e.g. 02/01/09 - 03/01/09
they would get the same result.

Is there some magical django way of achieving this without looping
over each day?

Thanks
--~--~-~--~~~---~--~~
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: question about admin.py list_display

2009-09-04 Thread Rob B (uk)

Solved over at

http://stackoverflow.com/questions/1378447/question-about-admin-py-listdisplay


On Sep 4, 11:28 am, "Rob B (uk)" <robtot...@googlemail.com> wrote:
> http://dpaste.com/89435/
>
> I'm trying to show game.status in GameListAdmin's list_display but not
> sure how to do a backwards lookup using the ForeignKey in Admin.py
>
> See link for details.
>
> Any ideas?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



question about admin.py list_display

2009-09-04 Thread Rob B (uk)

http://dpaste.com/89435/

I'm trying to show game.status in GameListAdmin's list_display but not
sure how to do a backwards lookup using the ForeignKey in Admin.py

See link for details.

Any ideas?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Need help getting the company I work for to go with django

2009-09-01 Thread Rob B (uk)

I work as a web developer at a reasonably large company in London. We
are just about to completely re brand and rebuild the companies website
(s) and implement a CMS.  I'm having a meeting tomorrow to discuss
different avenues we can go down in regards to what technologies we
can use.  I'm hoping to steer them towards Django!

If you were me how would you sell Django to fellow developers and
business (non-techies) people??

The CMS will need to cope with million+ hits a month & have
multilingual support.

P.S. I know django isn't a CMS. I want to build a custom one using it.


--~--~-~--~~~---~--~~
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: user online

2009-08-10 Thread Rob B (uk)

Brill thanks. Its actaully working!  Getting a the IDs with the
template:
{% for user_set in online_users %}
{{ user_set }}
{% empty %}
To list the usernames instead of the ID will I need to update the view
or is there a clever trick with the template?


On Aug 10, 11:02 pm, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On Aug 10, 10:45 pm, "Rob B (uk)" <robtot...@googlemail.com> wrote:
>
> > Im reading through loads of python / django tutorials atm, hopefully
> > some of it will stick!
>
> > I added what you suggested and now I'm getting the error "type object
> > 'OnlineUsers' has no attribute 'get_online_user_ids'"
> > view -http://dpaste.com/77965/
> > middleware (name OnlineUsers) -http://dpaste.com/77967/
> > What am I doing wrong now?
>
> > Thanks R
>
> You've imported get_online_user_ids directly, so you don't in fact
> need to use OnlineUsers again to call it - in this case Python think
> you're talking about a class method of the OnlineUsers middleware
> class which you also import (really it's best to keep class names
> different from the modules they live in).
>
> So you just need to do:
> { 'profile_list': Profile.objects.all(), 'online_users':
> get_online_user_ids() }
> --
> DR.
--~--~-~--~~~---~--~~
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: user online

2009-08-10 Thread Rob B (uk)

Im reading through loads of python / django tutorials atm, hopefully
some of it will stick!

I added what you suggested and now I'm getting the error "type object
'OnlineUsers' has no attribute 'get_online_user_ids'"
view - http://dpaste.com/77965/
middleware (name OnlineUsers) - http://dpaste.com/77967/
What am I doing wrong now?

Thanks R



On Aug 10, 8:32 pm, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On Aug 10, 7:10 pm, "Rob B (uk)" <robtot...@googlemail.com> wrote:
>
> > Thanks Daniel.
> > Im still quite new to python / django and not sure how to pass
> > OnlineUsers.get_online_user_ids() into the context. My view to list
> > all profiles looks like this:
> > def profile_list(request):
>
> >         return render_to_response('profile_list.html',
>
> >                               { 'profile_list': Profile.objects.all
> > () }, context_instance=RequestContext(request))
>
> You pass it exactly as you are passing the list of profile objects:
> { 'profile_list': Profile.objects.all(),
>   'online_users': OnlineUsers.get_online_user_ids() }
>
> You really need to read an introductory Python tutorial - you must at
> least know how to define variables like dictionaries, and how to call
> functions.
> --
> DR.
--~--~-~--~~~---~--~~
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: user online

2009-08-10 Thread Rob B (uk)

Thanks Daniel.
Im still quite new to python / django and not sure how to pass
OnlineUsers.get_online_user_ids() into the context. My view to list
all profiles looks like this:
def profile_list(request):

return render_to_response('profile_list.html',

  { 'profile_list': Profile.objects.all
() }, context_instance=RequestContext(request))



On 9 Aug, 22:16, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On Aug 9, 10:07 pm, "Rob B (uk)" <robtot...@googlemail.com> wrote:
>
> > Im using this middleware to try and display a list ofonlineuser on
> > my site.http://dpaste.com/77464/
>
> > Im just not sure how to pass it to my view and template.  Any ideas?
>
> > Middleware found 
> > @http://groups.google.com/group/django-users/browse_thread/thread/6f5f...
>
> > Thanks
>
> Jeremy explains how to do it in the message you link to:
> "You'll want to use OnlineUsers.get_online_user_ids() wherever you
> need
> the list of IDs. "
>
> ie import the OnlineUsers module in your view and pass
> OnlineUsers.get_online_user_ids() into the context.
> --
> DR.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



django-cms-2.0 problem

2009-08-10 Thread Rob B (uk)

Trying to get a default install of :
http://github.com/digi604/django-cms-2.0/
up and running on my dev but I'm getting this error when trying to log
into admin
http://dpaste.com/77696/

Any ideas?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



user online

2009-08-09 Thread Rob B (uk)

Im using this middleware to try and display a list of online user on
my site.
http://dpaste.com/77464/

Im just not sure how to pass it to my view and template.  Any ideas?

Middleware found @
http://groups.google.com/group/django-users/browse_thread/thread/6f5f759d3fd4318a/

Thanks
--~--~-~--~~~---~--~~
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: URL & DB question

2009-08-02 Thread Rob B
Well it works a treat so big thanks.

2009/8/2 Chris Withers <ch...@simplistix.co.uk>

>
> Rob B wrote:
> > Great I didn't know about that one.  I'm curious to what are the
> > benefits of doing it that are?
>
> Less code for you to write and maintain :-)
>
> Chris
>
> --
> Simplistix - Content Management, Batch Processing & Python Consulting
>- http://www.simplistix.co.uk
>
> >
>

--~--~-~--~~~---~--~~
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: URL & DB question

2009-08-02 Thread Rob B
Great I didn't know about that one.  I'm curious to what are the benefits of
doing it that are?

Thanks

2009/8/2 Chris Withers <ch...@simplistix.co.uk>

>
> Rob B (uk) wrote:
> > Solved it by doing this:
> >
> > def profile_detail(request, name):
> > p = get_object_or_404(Profile, name=name)
> > return render_to_response('profile_detail.html', {'name': p})
>
> How about using the detail generic view:
>
> from django.views.generic.list_detail import object_detail
>
> urlpatterns = patterns('',
>  (r'^(?P[\w\._-]+)/$',
>   object_detail,
>   {'queryset':Profile.objects.all()}))
>
> cheers,
>
> Chris
>
> --
> Simplistix - Content Management, Batch Processing & Python Consulting
>- http://www.simplistix.co.uk
>
> >
>

--~--~-~--~~~---~--~~
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: URL & DB question

2009-08-01 Thread Rob B (uk)

Solved it by doing this:

def profile_detail(request, name):
p = get_object_or_404(Profile, name=name)
return render_to_response('profile_detail.html', {'name': p})



On 1 Aug, 12:22, "Rob B (uk)" <robtot...@googlemail.com> wrote:
> Using the url to look up a user profile just not sure what to put in
> the view. Any suggestions welcome.
>
> Model:
> class Profile(models.Model):
>     title = models.ForeignKey(User, unique=True)
>     name = models.CharField(max_length=50, null=False, blank=False)
>
>     def __unicode__(self):
>                 return self.name
>
> URL:
> (r'^(?P[\w\._-]+)/$', 'mysite.profiles.views.profile_detail'),
>
> View:
> def profile_detail(request, name):
>     name = get_list_or_404(Profile, name=name)
>     return render_to_response('profile_detail.html',  now what?
>
> Thanks
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



URL & DB question

2009-08-01 Thread Rob B (uk)

Using the url to look up a user profile just not sure what to put in
the view. Any suggestions welcome.

Model:
class Profile(models.Model):
title = models.ForeignKey(User, unique=True)
name = models.CharField(max_length=50, null=False, blank=False)

def __unicode__(self):
return self.name

URL:
(r'^(?P[\w\._-]+)/$', 'mysite.profiles.views.profile_detail'),

View:
def profile_detail(request, name):
name = get_list_or_404(Profile, name=name)
return render_to_response('profile_detail.html',  now what?



Thanks
--~--~-~--~~~---~--~~
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: Also-Online Feature

2009-07-26 Thread Rob B
A few links that might help...
http://groups.google.com/group/django-users/browse_thread/thread/4ba5652bcbd1f958
http://www.djangosnippets.org/snippets/947/


2009/7/26 Jonas Obrist 

>
> Is there a builtin way in django to get a list of other users who are
> currently visiting a website or even a specific part of a website? If
> not are there any tools that I could use to implement this or do I have
> to think of a solution from scratch?
>
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



urls.py error: unbalanced parenthesis

2009-07-19 Thread Rob B (uk)

Getting a unblanced parenthesis error with this urls setup. Not sure
why.

urls.py:
from django.conf.urls.defaults import *
from coltrane.models import Entry

entry_info_dict = {
'queryset': Entry.objects.all(),
'date_field': 'pub_date',
}

urlpatterns = patterns('django.views.generic.date_based',
 (r'^$', 'archive_index', entry_info_dict,
'coltrane_entry_archive_index'),
 (r'^(?P\d{4}/$', 'archive_year', entry_info_dict,
'coltrane_entry_archive_year'),
 (r'^(?P\d{4}/(?P\w{3})/$', 'archive_month',
entry_info_dict, 'coltrane_entry_archive_month'),
 (r'^(?P\d{4}/(?P\w{3})/(?P\d{2}/)$',
'archive_day', entry_info_dict, 'coltrane_entry_archive_day'),
 (r'^(?P\d{4}/(?P\w{3})/(?P\d{2})/(?P[-
\w]+)/$', 'object_detail', entry_info_dict,  'coltrane_entry_detail'),
)
--~--~-~--~~~---~--~~
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: Stuck re:Practical Django Projects 2nd E...

2009-07-18 Thread Rob B
Huge thanks Tanja - worked a treat.

Any ideas why the book has it the other way around?

2009/7/18 klaut <tanja.pis...@gmail.com>

>
>
>
> On Jul 18, 6:30 pm, "Rob B (uk)" <robtot...@googlemail.com> wrote:
> > Bit stumped on chapter 4.
> >
> > Every thing is working except I'm getting a 'Page not found (404)'
> > when I try to view any entries.
> >
> > View:
> > def entry_detail(request, year, month, day, slug):
> > import datetime, time
> > date_stamp = time.strptime(year+month+day, "%Y%b%d")
> > pub_date = datetime.date(*date_stamp[:3])
> > return render_to_response('coltrane/entry_detail.html',
> >   { 'entry': Entry.objects.get
> > (pub_date__year=pub_date.year,
> >
> > pub_date__month=pub_date.month,
> >
> > pub_date__day=pub_date.day,
> >
> > slug=slug) })
> >
> > Url:
> > (r'^weblog/(?P\d{4})/(?P\w{3})/(?P\d{2})/(P?[-
> > \w]+)/$', 'coltrane.views.entry_detail'),
> >
> > Any ideas?
>
> Yes. You should switch the ... P? .. part to  ...?P ...
> The question mark should precede the character P.
>
> Hope it helps.
> Tanja
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Stuck re:Practical Django Projects 2nd E...

2009-07-18 Thread Rob B (uk)

Bit stumped on chapter 4.

Every thing is working except I'm getting a 'Page not found (404)'
when I try to view any entries.

View:
def entry_detail(request, year, month, day, slug):
import datetime, time
date_stamp = time.strptime(year+month+day, "%Y%b%d")
pub_date = datetime.date(*date_stamp[:3])
return render_to_response('coltrane/entry_detail.html',
  { 'entry': Entry.objects.get
(pub_date__year=pub_date.year,
 
pub_date__month=pub_date.month,
 
pub_date__day=pub_date.day,
 
slug=slug) })

Url:
(r'^weblog/(?P\d{4})/(?P\w{3})/(?P\d{2})/(P?[-
\w]+)/$', 'coltrane.views.entry_detail'),


Any ideas?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---