Created
April 7, 2012 17:11
-
-
Save bacher09/2330507 to your computer and use it in GitHub Desktop.
pseudo model
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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