# styles admin teaser

**URL:** <https://discourse.citationstyles.org/t/styles-admin-teaser/431>\
**Category:** CSL Development\
**Created:** [February 17, 2008, 8:20pm UTC](https://discourse.citationstyles.org/t/styles-admin-teaser/431 "2008-02-17T20:20:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [February 17, 2008, 8:20pm UTC](https://discourse.citationstyles.org/t/styles-admin-teaser/431/1 "2008-02-17T20:20:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kieren\_Diment](https://avatars.discourse-cdn.com/v4/letter/k/77aa72/32.png) [@Kieren\_Diment](https://discourse.citationstyles.org/u/Kieren_Diment)\
**Post date:** [February 17, 2008, 9:24pm UTC](https://discourse.citationstyles.org/t/styles-admin-teaser/431/2 "2008-02-17T21:24:05Z")

</div>

Looks interesting. Got any source code anywhere?

Kieren

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [February 17, 2008, 9:49pm UTC](https://discourse.citationstyles.org/t/styles-admin-teaser/431/3 "2008-02-17T21:49:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kieren\_Diment](https://avatars.discourse-cdn.com/v4/letter/k/77aa72/32.png) [@Kieren\_Diment](https://discourse.citationstyles.org/u/Kieren_Diment)\
**Post date:** [February 17, 2008, 9:56pm UTC](https://discourse.citationstyles.org/t/styles-admin-teaser/431/4 "2008-02-17T21:56:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [February 19, 2008, 7:35pm UTC](https://discourse.citationstyles.org/t/styles-admin-teaser/431/5 "2008-02-19T19:35:33Z")

</div>

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/](http://xbiblio.svn.sourceforge.net/viewvc/xbiblio/csl_gallery/)

Turns out you can use git with SVN, though 😉

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

---

<div class="post-metadata">

**Author:** ![Johan\_Kool2](https://avatars.discourse-cdn.com/v4/letter/j/cab0a1/32.png) [@Johan\_Kool2](https://discourse.citationstyles.org/u/Johan_Kool2)\
**Post date:** [February 20, 2008, 12:35am UTC](https://discourse.citationstyles.org/t/styles-admin-teaser/431/6 "2008-02-20T00:35:09Z")

</div>

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](https://johankool.nl/)**
>
> I write apps for iOS and macOS. I am based in Rotterdam, the Netherlands.

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [February 20, 2008, 2:32am UTC](https://discourse.citationstyles.org/t/styles-admin-teaser/431/7 "2008-02-20T02:32:47Z")

</div>

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
