styles admin teaser

So I made some progress on this web app. If curious, see attached for
a screenshot of how the default Django admin app handles style
creation and editing.

Once I get the models solid, I’ll work on filling up the database
macros and such, and on the views.

Bruce

Looks interesting. Got any source code anywhere?

Kieren

It’s sitting on my desktop box ATM, and I’m experimenting with Git for
SCM (seem to have everything I like about darcs, without at least the
installation headaches).

I’d like to get a little farther and clean it up a bit before making
it available, but I assume that can be fairly soon.

Any opinions about how I should do that? Informal distributed Git?
Load it in the XBib SVN?

FWIW, here’s the model definition for the Style class that you see
represented in the screenshot:

class Style(models.Model):
title = models.CharField(max_length=100)
slug = models.SlugField(prepopulate_from=(“title”,))
categories = models.ManyToManyField(Category)
author = models.ForeignKey(User)
citation = models.ForeignKey(Context,
limit_choices_to={‘type’:‘C’}, related_name=“styles_style_citation”)
bibliography = models.ForeignKey(Context, limit_choices_to={‘type’:‘B’},

related_name=“styles_style_bibliography”, blank=True)
preview = models.TextField(blank=True)
created = models.DateTimeField()
updated = models.DateTimeField()

def __unicode__(self):
    return self.title

class Admin:
    pass

class Meta:
    ordering = ['title']

Bruce

I vote git there - I want to start using it (gone to some trouble to
get it installed in a hostile environment too there), and I can see
the advantages over svn.

Ah, I got lazy (and busy) and just loaded it in the xbib svn, at least for now:

http://xbiblio.svn.sourceforge.net/viewvc/xbiblio/csl_gallery/

Turns out you can use git with SVN, though :wink:

Warning: what I’ve committed is incomplete and kind of lame. A lot of
the URLs and views are not yet defined, for example (the one exception
is the root homepage, and the “by title” list of styles.

Oh, and the CSS could benefit from the help of a real designer.

But it’s at least a good start I think, and has a lot of promise. The
basic modeling seems pretty much right, and the admin inteface is
working fine (aside from the bugs with the XMLField). Talking a bit
with Johan off-list, his work on citeproc-py ought to fit in really
nicely for adding a preview rendering method for macros, templates,
and styles.

Django’s template system is really nice, BTW. I plan to add templates
fro generating the actual CSL files. And since Django has built-in
support for Atom, it’d be drop-dead easy to add Atom feeds by
category, etc.

If anybody is interested in playing with or helping with this and has
problems getting going, just let me know. I plan to flesh it out over
the next week so it’s more functional.

Bruce

A quick update on my progress: CiteProc-Py can now import CSL and
export it back out again quite well. I tested it with three styles and
there were no significant difference between the input and output,
just whitespace and attribute order differences.

One quick question though, it is safe to omit an empty attribute,
right? Like for example if it says prefix=“” CiteProc-Py now simply
doesn’t write out that attribute. Is that correct or is there a
difference between no prefix attribute and prefix=“”, or any other
attributes for that matter?

JohanOp 19 feb 2008, om 20:35 heeft Bruce D’Arcus het volgende geschreven:

But it’s at least a good start I think, and has a lot of promise. The
basic modeling seems pretty much right, and the admin inteface is
working fine (aside from the bugs with the XMLField). Talking a bit
with Johan off-list, his work on citeproc-py ought to fit in really
nicely for adding a preview rendering method for macros, templates,
and styles.


Johan Kool wrote:

A quick update on my progress: CiteProc-Py can now import CSL and
export it back out again quite well. I tested it with three styles and
there were no significant difference between the input and output,
just whitespace and attribute order differences.

Great, which is totally fine of course.

One quick question though, it is safe to omit an empty attribute,
right? Like for example if it says prefix=“” CiteProc-Py now simply
doesn’t write out that attribute. Is that correct or is there a
difference between no prefix attribute and prefix=“”, or any other
attributes for that matter?

in having a prefix that has no content.

BruceFrom my perspective, you’re doing the correct thing. There’s no point