[Dev-flock] recent activity

Lucy Mendel lucy at thoughtandmemory.org
Wed Jun 11 09:09:41 EDT 2008


just remembered: the bug in trunk's version of impact.html gives a
'NodeType' has no attribute 'source' error. i've seen this before when
adding a %} in the wrong place, so maybe the template tags have a bug?
it's weird how the error is in a django debug.py file--is that
something you added dan? When I saw the error in my version of
impct.html it gave a main,py error, i believe. not necessary more
helpful, since it was the template at fault.

btw, dan: pane makes sense for using, but it'd be good to know how the
added template tags work ot make it easier to figure them out since we
lack documentation (and anyway, maybe we'll want to modify them or add
more). the case tag also makes sense, but i wonder if that has a bug
in it wrt an extra %} or something.

On Wed, Jun 11, 2008 at 3:59 AM, Lucy Mendel <lucy at thoughtandmemory.org> wrote:
> yo,
> i played around with the
>     templates/user/impact.html
> code.
>
> it looks like logging has been turned off, since recent activity is no
> longer being logged (see hm/db/log.py to see what i'm talking about)
>
> at the bottom of the email is the svn diff of my changes n case you're
> interested.
>
> fYI - dan and I are going to meet at the end of june, some
> 20-something day, to prioritize more concrete tasks for the code
> cleanup. we plan to work hard to get the repo into a more manageable
> state (eg, fixing broken template tags and documenting their use on
> the wiki,  or removing their use from the code) by the end of July.
> this is the most important task period.  the easier new developers can
> ramp up on the code and not get frustrated with brokenness or
> inconsistency the more developers will have fun coding. we all know
> that's the real goal for the organization, right?
> there are several fun modules to work on at this point, so don't miss out.
>
> i'm falling asleep now, so i'll send another email later about the
> status of other projects. i have some more status-type stuff to post
> tot he cellphone system/data gathering wiki, though it is public if
> you want to check it out.
>
> good luck,
> l.
>
> Index: app/views/main.py
> ===================================================================
> --- app/views/main.py   (revision 845)
> +++ app/views/main.py   (working copy)
> @@ -126,7 +126,7 @@
>     for beh in my_behaviors:
>         for arg in beh.arguments:
>             data = data + get_arg_json(arg)
> -
> +
>     data = "{'arguments': [" + data.rstrip(",") + "]}"
>     return HttpResponse( data,  mimetype="text/javascript" )
>
> @@ -308,13 +308,23 @@
>
>     # convert to int else
>     uid = int(user_id)
> -
> +
> +    actions = []
>     # selected user; uid==0 means no user selected
>     if uid > 0:
>         user_selected = True
>         # TODO: currently no UserExtended objects exist. There should be
>         # a 1-to-1 mapping between Users and UserExtended
>         user = User.objects.select_related().get(id=uid)
> +        # get last 10 actions taken by user
> +        #for a in Action.by_user(user)[:10]:
> +        #    a_data = {'time':a.time,
> +        #              'label':a.item.label,
> +        #              'description':a.item.description,
> +        #              'item_type':a.item_type,
> +        #              'item':a.item,
> +        #              'item_id':a.item_id,}
> +        #    actions.append(a_data)
>     else:
>         user_selected = False
>         user = 0;
> @@ -322,6 +332,7 @@
>     dict['user']=user
>     dict['page']='user'
>     dict['profile']=user.profile
> +    #dict['actions']=actions
>
>     return render_to_response('user/page.html', dict)
>
> Index: app/templates/user/page.html
> ===================================================================
> --- app/templates/user/page.html        (revision 845)
> +++ app/templates/user/page.html        (working copy)
> @@ -12,9 +12,9 @@
>  {% endblock %}
>
>  {% block content_half_left %}
> -       {# include 'user/profile.html' #}
> +       {% include 'user/profile.html' %}
>  {% endblock %}
>
>  {% block content_half_right %}
> -    {# include 'user/impact.html' #}
> +    {% include 'user/impact.html' %}
>  {% endblock %}
> Index: app/templates/user/impact.html
> ===================================================================
> --- app/templates/user/impact.html      (revision 845)
> +++ app/templates/user/impact.html      (working copy)
> @@ -2,37 +2,23 @@
>  {% pane "impact" "Actions and Impact" %}
>
>        {% for ua in user.profile.actions|order:"-time"|limit:10 %}
> -    {% let item=ua.item %}
> -    {% case item|typename %}
> -      {% when "Rating" %}
> -        You gave {{item.item}} a score of {{item.score}}
> -      {% when "Tag" %}
> -        Tag
> -      {% when "Tagging" %}
> -        Tagging
> -      {% when "Node" %}
> -        You created {{item.label}}
> -      {% when "Edge" %}
> -        Edge
> -      {% when "Behavior" %}
> -        Review
> -      {% when "Argument" %}
> -        Review
> -      {% when "Dimension" %}
> -        Dimension
> -      {% when "Author" %}
> -        Author
> -      {% when "Source" %}
> -        Source
> -      {% when "Article" %}
> -        Article
> -      {% when "Citation" %}
> -        Citation
> -      {% else %}
> -        Not sure what you did...
> -        {{ item|typename }}
> -    {% endcase %}
> -    <br />
> +               {{ ua.time|date:"F jS, Y H:i" }}:
> +        {% ifequal ua.item_type.name "argument" %}
> +                 You reviewed the ua.item.behavior.dimension interest
> on ua.item.behavior.node
> +               {% endifequal %}
> +        {% ifequal ua.item_type.name "behavior" %}
> +                 You reviewed the ua.item.dimension interest on ua.item.node
> +               {% endifequal %}
> +        {% ifequal ua.item_type.name "dimension" %}
> +                 You added the ua.item.label interest
> +               {% endifequal %}
> +        {% ifequal ua.item_type.name "rating" %}
> +                 You gave {{item.item}} a score of {{imte.score}}
> +               {% endifequal %}
> +        {% ifequal ua.item_type.name "node" %}
> +                 You created {{ua.item.label}}
> +               {% endifequal %}
> +        <br />
>        {% endfor %}
>   <p> TODO: show user's actions. and impact of actions.</p>
>



More information about the Dev-flock mailing list