Re: ANN: django-morsels

2008-08-28 Thread Richard Ward

I just checked out the newest revision and it works!

I am certain this will be a very handy asset.

To debug the issue you can use the {% debug %} template tag.

Thank you,

Richard

On Sun, Aug 24, 2008 at 6:11 AM, Richard Ward <[EMAIL PROTECTED]> wrote:
> I too am unable to display the morsels.
>
> I believe it is install correctly.
>
> I can add morsels.
> The morsel tag generates no error when the template is generated.
>
> This is my context setting:
> TEMPLATE_CONTEXT_PROCESSORS = (
>"django.core.context_processors.auth",
>"django.core.context_processors.debug",
>"django.core.context_processors.i18n",
>"django.core.context_processors.media",
>"django.core.context_processors.request",
> )
>
> I do not know how to debug the installation.
>
>
> Thanks
> Richard
>
> On Sat, Aug 23, 2008 at 12:04 AM, Itai Tavor <[EMAIL PROTECTED]> wrote:
>>
>> 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
>

Re: ANN: django-morsels

2008-08-26 Thread Itai Tavor

I think flatpages definitely still have their uses. Morsels don't  
create new pages, they only get shown on existing ones.
With the flatpage fallback middleware, flatpage xml sitemaps and a bit  
of custom navigation code you can let users add pages anywhere they  
want in a site and have it show up in menus.

Of course, you could achieve the same effect by applying some of the  
flatpage app code to morsels, but it will just confuse users, having  
morsels that just customize content in existing pages mixed in with  
others that create new pages.

A more interesting suggestion, IMO, would be to merge flatpages and  
morsels into a single app, which would make sense because both deal  
with static, admin-editable content. FlatThings?

Itai

On 27/08/2008, at 12:00 AM, lingrlongr wrote:

>
> It makes me wonder now though.  If I can just include a bunch of
> morsels on a page, why even bother using flatpages anymore??  That
> just makes things more difficult to maintain.  Thoughts?
>
> 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 > >.
>>
>> 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
-~--~~~~--~~--~--~---



Re: ANN: django-morsels

2008-08-26 Thread lingrlongr

It makes me wonder now though.  If I can just include a bunch of
morsels on a page, why even bother using flatpages anymore??  That
just makes things more difficult to maintain.  Thoughts?

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



Re: ANN: django-morsels

2008-08-24 Thread Itai Tavor

Hi Richard,

Can you provide more information? What URL did you enter in the  
morsel, and at what URL are you viewing the template that tries to  
include the morsel? Also, does your SITE_ID setting match the site you  
selected in the morsel?

Itai


On 24/08/2008, at 9:11 PM, Richard Ward wrote:

>
> I too am unable to display the morsels.
>
> I believe it is install correctly.
>
> I can add morsels.
> The morsel tag generates no error when the template is generated.
>
> This is my context setting:
> TEMPLATE_CONTEXT_PROCESSORS = (
>"django.core.context_processors.auth",
>"django.core.context_processors.debug",
>"django.core.context_processors.i18n",
>"django.core.context_processors.media",
>"django.core.context_processors.request",
> )
>
> I do not know how to debug the installation.
>
>
> Thanks
> Richard
>
> On Sat, Aug 23, 2008 at 12:04 AM, Itai Tavor <[EMAIL PROTECTED]>  
> wrote:
>>
>> 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://cod

Re: ANN: django-morsels

2008-08-24 Thread Richard Ward

I too am unable to display the morsels.

I believe it is install correctly.

I can add morsels.
The morsel tag generates no error when the template is generated.

This is my context setting:
TEMPLATE_CONTEXT_PROCESSORS = (
"django.core.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.request",
)

I do not know how to debug the installation.


Thanks
Richard

On Sat, Aug 23, 2008 at 12:04 AM, Itai Tavor <[EMAIL PROTECTED]> wrote:
>
> 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  >.
>>>
> 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, sen

Re: ANN: django-morsels

2008-08-22 Thread Itai Tavor

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



Re: ANN: django-morsels

2008-08-22 Thread lingrlongr

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



Re: ANN: django-morsels

2008-08-22 Thread lingrlongr

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



Re: ANN: django-morsels

2008-08-22 Thread lingrlongr

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



Re: ANN: django-morsels

2008-08-22 Thread Jorge Vargas

thanks seems interesting.

On Thu, Aug 21, 2008 at 3: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-morsels are:
>
> * Each morsel can be tied to a site page by specifying the page's URL
> in the morsel.
>
> * Different morsels can be used in the same page by adding arbitrary
> names to the morsel's URL.
>
> * Morsels can 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 other morsels in
> specific pages within the section.
>
> * Morsels can 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 - allow morsels to
> be used in various, flexible ways.
>
> * Morsels can be locked, which prevents them from being deleted. This
> is intended to prevent accidental deletion of required morsels, 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-morsels at  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
-~--~~~~--~~--~--~---



ANN: django-morsels

2008-08-21 Thread Itai Tavor

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-morsels are:

* Each morsel can be tied to a site page by specifying the page's URL  
in the morsel.

* Different morsels can be used in the same page by adding arbitrary  
names to the morsel's URL.

* Morsels can 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 other morsels in  
specific pages within the section.

* Morsels can 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 - allow morsels to  
be used in various, flexible ways.

* Morsels can be locked, which prevents them from being deleted. This  
is intended to prevent accidental deletion of required morsels, 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-morsels at .

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