def get_dynamic_preview(self, fieldname, s, objid): if fieldname == 'tweet_template': if objid: o = self.Meta.model.objects.get(pk=objid) return render_sandboxed_template(s, { 'benefit': o, 'level': o.level, 'conference': o.level.conference, 'sponsor': Sponsor(name='Test'), 'sponsor': Sponsor(name='Test', displayname="Test", twittername="@twittertest"), }) return ''
def generate_tweet(cls, conference, session, s): return render_sandboxed_template(s, { 'conference': conference, 'session': session, }).strip()