cool thats useful but more advice form other people would be great I  
will try that thank you
On 30 May 2008, at 15:37, Jack M. wrote:

>
> Forgive me if this is a little off but, to have the argument passed
> into the view, you'd want to use some different regexp:
> (r'^shows/(\w+)','ubermicro.shows.views.show_page'),
> is what I would suggest.  This will put the show requested as a
> string, into the view:
> def show_page(request, show):
> So the string input after show/ would be in the show variable.
>
> Another option would be to have two regexp:
>     (r'^shows/(\d+)','ubermicro.shows.views.show_page') ## This will
> match any individual number passed.
>     (r'^shows/forever','ubermicro.shows.views.show_all_pages') ## This
> will match only the forever request.
>
>
> /2 cents.
>
> On May 30, 6:41 am, sebey <[EMAIL PROTECTED]> wrote:
>> no that didn't work its still the same rss feed here is my models:
>>
>> from django.db import models
>>
>> class show(models.Model):
>>     """gets the show_rss feed"""
>>     show_title = models.CharField(blank=True, maxlength=100)
>>     show_feed = models.URLField(blank=True, verify_exists=True)
>>
>>     class Admin():
>>         list_display = ('show_title','show_feed')
>>
>>     def __str__(self):
>>             return self.show_feed
>>
>> and here are my views:
>>
>> from django.http import HttpResponse
>> import feedparser
>> from ubermicro.shows.models import show
>> from django.template import Context, loader
>>
>> def show_page(request):
>>     """this is where we take what we need form the rss feeds in the
>> data base"""
>>     query = show.objects.filter(show_feed__contains="http://";)
>>     for s in query:
>>         podcast = feedparser.parse(s.show_feed)
>>         if  podcast.entries:
>>             elements = {'show_about':
>> podcast.feed.summary,'show_latest_title':
>> podcast.entries[0].title,'show_latest': podcast.entries[0].summary}
>>     e = elements
>>     t = loader.get_template('shows/show_page_base.html')
>>     return  HttpResponse(t.render(Context(e)))
>>
>> and my urls:
>>
>> from django.conf.urls.defaults import *
>>
>> urlpatterns = patterns('',
>>     # Example:
>>     # (r'^ubermicro/', include('ubermicro.foo.urls')),
>>
>>     # Uncomment this for admin:
>>     (r'^admin/', include('django.contrib.admin.urls')),
>>     #temp only fo dev proposes
>>     (r'^shows/*','ubermicro.shows.views.show_page')
>> )
>>
>> and the tester template I am using:
>>
>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>>         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
>>
>> <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
>> <head>
>>         <meta http-equiv="Content-Type" content="text/html;  
>> charset=utf-8"/>
>>
>>         <title>show_page_base</title>
>>
>> </head>
>>
>> <body>
>>
>> <p>{{show_about}}</p>
>> <p>{{show_latest_title}}</p>
>> <p>{{show_latest}}</p>
>>
>> </body>
>> </html>
>>
>> thanks sorry for it being so long
>
> >

see ya

sebey



--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to