Usage of django-model-utils TimeFramedModel manager

2013-08-15 Thread Ogre
Hi all,

I've a model defined as thus:

from model_utils.models import TimeFramedModel

class Event(TimeFramedModel):
title=models.CharField(max_length=100)
...

The 
docsare
 a bit slim on the ground for this one, but how do you use the added 
"timeframed" 
manager
?

I've tried Event.timeframed.filter(start=X, end=Y) but to no avail. Any 
help?

Cheers.

-- 
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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Pass template tags through TextField?

2009-07-22 Thread Ogre

Perfect.  Thanks, Dan.


On Jul 22, 10:23 am, Dan Harris  wrote:
> That shouldn't be a problem, after all templates are just strings as
> are textfields.
>
> If you have a model with your textfield in it as so:
>
> class MyModel(models.Model):
>    template = models.TextField()
>
> and you have a view which renders the template defined in the next
> field
>
> def my_view(request):
>    m = MyModel.objects.get(pk=1)  # for example the first one
>
>    t = Template(m.template)  #this creates a template from your string
> in the model
>    c = Context({'form': form, etc.. #any context to go into the
> template})
>
>   # now you can just return the rendered template as html
>   return HttpResponse(t.render(c))
>
> For more info refer 
> to:http://docs.djangoproject.com/en/dev/ref/request-response/
>
> Cheers,
>
> Dan
>
> On Jul 22, 12:49 pm, Ogre  wrote:
>
> > I have a model where I need to be able to insert template tags into a
> > TextField in the admin as part of the content and then have them
> > rendered properly on the front-end.
>
> > Can this be done?  And if so, can someone recommend a method?  I
> > understand the security concerns of opening that field up to python.
>
> > Thanks in advance.
>
>
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Pass template tags through TextField?

2009-07-22 Thread Ogre

I have a model where I need to be able to insert template tags into a
TextField in the admin as part of the content and then have them
rendered properly on the front-end.

Can this be done?  And if so, can someone recommend a method?  I
understand the security concerns of opening that field up to python.

Thanks in advance.

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