Apologies to everyone who got bit by this. I updated the INSTALL  
instructions with the requirement of adding 'request' to the context.

Itai


On 23/08/2008, at 6:26 AM, lingrlongr wrote:

>
> Recommended fix @ http://code.google.com/p/django-morsels/issues/detail?id=1
>
> On Aug 22, 2:51 pm, lingrlongr <[EMAIL PROTECTED]> wrote:
>> If I change my view to this, it works:
>>
>> # views.py
>> def myview(request):
>>     return object_list(
>>         request,
>>         queryset=Stuff.objects.all(),
>>         extra_context = {
>>           'request': request,
>>         }
>>     )
>>
>> Is this supposed to be the right way to use morsels?
>>
>> Keith
>>
>> On Aug 22, 12:50 pm, lingrlongr <[EMAIL PROTECTED]> wrote:
>>
>>> I can't get this to work at all.  Seems to bomb here:
>>
>>> class MorselManager(models.Manager):
>>>     def get_for_current(self, context, name, inherit=False):
>>>         if not context.has_key('request'):      <------ key never
>>> seems to exist
>>>             return None
>>
>>> I have a morsel defined with a URL of "/mypage/".
>>
>>> # urls.py
>>> (r'^mypage/$', myview),
>>
>>> # views.py
>>> def myview(request):
>>>     return object_list(
>>>         request,
>>>         queryset=Stuff.objects.all(),
>>>     )
>>
>>> I have this in my template:
>>> {% load morsel_tags %}
>>> {% morsel %}
>>
>>> Am I missing something?
>>
>>> Keith
>>
>>> On Aug 21, 5:19 am, Itai Tavor <[EMAIL PROTECTED]> wrote:
>>
>>>> At first glance (and, quite possibly, second and third) django- 
>>>> morsels
>>>> might look like a clone of django-chunks 
>>>> (http://code.google.com/p/django-chunks/
>>>> ). Both apps attempt to solve the same problem, and in fact, I  
>>>> wrote
>>>> this app after seeing and trying out django-chunks (so thanks,  
>>>> Clint
>>>> Ecker!). But the feature set and functions differ enough to justify
>>>> the existence of a second implementation.
>>
>>>> These apps provide a way to store partial page content in the
>>>> database, and manage it in the admin app, when this content is
>>>> integrated in pages that also contain dynamic features. I always  
>>>> dealt
>>>> with this using FlatPages and templatetags (custom-written for each
>>>> new project) that included them in templates. Looking at django-
>>>> chunks, I realized a few things:
>>
>>>> 1) The templatetags I've already written worked better, for my own
>>>> use, than the key-based approach of django-chunks.
>>>> 2) Using a dedicated model for this type of content made a lot of  
>>>> sense.
>>>> 3) Merging this model and all those custom templatetags I already  
>>>> had
>>>> into a reusable app also made sense.
>>>> 4) I needed a name that didn't have "chunks" in it.
>>
>>>> The main features of django-morselsare:
>>
>>>> * Each morsel can be tied to a site page by specifying the page's  
>>>> URL
>>>> in the morsel.
>>
>>>> * Differentmorselscan be used in the same page by adding arbitrary
>>>> names to the morsel's URL.
>>
>>>> *Morselscan be inherited from higher levels in the site's URL
>>>> hierarchy. This allows the content of a single morsel to be  
>>>> displayed
>>>> in a whole site section, while being overriden by othermorselsin
>>>> specific pages within the section.
>>
>>>> *Morselscan include an optional title, which may be used to  
>>>> identify
>>>> the morsel and may also be displayed in templates using the morsel.
>>
>>>> * Two custom templatetags - morsel and withmorsel - allowmorselsto
>>>> be used in various, flexible ways.
>>
>>>> *Morselscan be locked, which prevents them from being deleted. This
>>>> is intended to prevent accidental deletion of requiredmorsels, as
>>>> having to explicitly unlock a morsel before deleting it should make
>>>> the user think twice about it.
>>
>>>> * If the typogrify app (http://code.google.com/p/typogrify/) is
>>>> installed, morsel content will be typogrified when rendered using  
>>>> the
>>>> morsel templatetag.
>>
>>>> You can find django-morselsat <http://code.google.com/p/django-morsels/ 
>>>> >.
>>
>>>> Itai
> >
>


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