Skip to content

Instantly share code, notes, and snippets.

@bacher09
Created April 7, 2012 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bacher09/2330507 to your computer and use it in GitHub Desktop.
Save bacher09/2330507 to your computer and use it in GitHub Desktop.
pseudo model
class AbsractDelModel(Model):
is_deleted = BoleanField(default = False)
class Meta:
abstract = True
class ArchesModel(Model):
name = CharField()
class LicensModel(ArchesModel):
description = TextField()
class Repository(LicensModel):
# And other fields
pass
class CategoriModel(Model):
category = CharField()
class PackageModel(Model):
name = CharField(unique = True, max_length = 254)
category = ForeingKey(CategoriModel)
# Different versions can have different licenses, or homepages.
class UseFlagModel(LicensModel):
name = CharField(unique = True)
class MetaDataModel(Model):
homepage = URLField()
description = TextField()
changelog = TextField()
changelog_hash = CharField()
manifest_hash = CharField()
# Some other info
class EbuildModel(AbsractDelModel):
package = ForeingKey(PackageModel)
repository = ForeingKey(Repository)
version = CharField()
metadata = Foreingkey(MetaDataModel)
use_flags = ManyToManyFiedl(UseFlagModel)
licenses = ManyToManyField(LicensModel)
ebuild_hash = CharField()
ebuld_datetime = DateTimeField(auto_now = True)
class Keyword(Model):
ebuild = ForeingKey(EbuildModel)
arch = ForeingKey(ArchesModel)
status = SmallIntegerField() # Stable or not, masked
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment