Hello,
Below is my code. I am converting Google App Engine project to Web2py.
Below is a part of code in dashboard.html. In code I am not able to
understand the line in bold. Please describe it to me if anyone
understands.
{% for instance in instance_list %}
<div class="value_row">
<div class="left_column">
<a href
="/formfiller/{{instance['form_instance_key'].id()}}">{{instance['instance_label']}}</a>
{% if instance['is_finalized'] %}
<a href
="https://storage.cloud.google.com/mantle-client-pdf/{{instance['form_instance_key'].urlsafe()}}.pdf"
target="_blank"><img src="/static/images/pdf.png"/></a>
{% endif %}
* <a href
="/addenda_review/{{instance['form_instance_key'].id()}}">Addenda
Review</a>*
</div>
<div
class="right_column">{{instance['form_title']}}</div>
</div>
{% endfor -%}
Here is a handler which loads dashboard.html with data.
class DashboardHandler(BaseHandler):
@user_required
def get(self):
user = self.user_info
if user['user_id'] is not None:
instance_list =
FormInstance().get_user_instance_list(user['user_id'])
form_list = Form().get_form_list(user['user_id'])
email = user['email_address']
alerts = Alert().get_alerts(email, user['user_id'])
invite_list = list()
for alert in alerts:
if alert.type == 'form_instance_invite':
invites = FormInstanceInvite.query(
FormInstanceInvite.invitee_email ==
user['email_address']).fetch()
for invite in invites:
query = User.gql("WHERE __key__ = :key",
key=invite.invitor)
invitor = query.get()
invitation = dict()
invitation['invite_key'] = invite.key.urlsafe()
invitation['ux_key'] = invite.form_ux_key.urlsafe()
invitation['instance_key'] =
invite.form_instance_key.urlsafe()
invitation['message'] = alert.message
invitation['invitor'] = invitor
invite_list.append(invitation)
self.render_template('dashboard/dashboard.html', {
'user': user,
'form_list': form_list,
'instance_list': instance_list,
'invite_list': invite_list,
'alerts': alerts
})
else:
self.redirect('login')
Thanks in advance.
Regds,
Malhar Vora
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.