예제 #1
0
class Price(models.NodeModel):
    _topic = u'energy'
    _parent = u'Amount'
    _description = u''
    _status = models.IntegerProperty(null=True,
                                     help_text=u'',
                                     verbose_name=u'status')
    _author = models.IntArrayProperty(
        null=True,
        help_text=u'People that edited this entity.',
        verbose_name=u'author')
    currency = models.StringProperty(
        null=True,
        help_text=
        u'The currency of the amount, using its 3-letter ISO-4217 code, e.g. USD, EUR, GBP etc.',
        verbose_name=u'Currency')
    year = models.DateTimeProperty(null=True,
                                   help_text=u'',
                                   verbose_name=u'Year')
    source = models.URLProperty(
        null=True,
        help_text=
        u'The URL (starting with http://) to your source. If the source is a book, enter the URL to the book at Google Books or Amazon.',
        verbose_name=u'Source')
    units = models.StringProperty(null=True,
                                  help_text=u'The value of the amount.',
                                  verbose_name=u'Value')

    class Meta:
        pass
예제 #2
0
class EnergyProduct(models.NodeModel):
    _topic = u'energy'
    _description = u'An energy Product represents the concrete emanation of an energy Project. It can be a mass-produced device or a power plant.'
    _status = models.IntegerProperty(null=True,
                                     help_text=u'',
                                     verbose_name=u'status')
    _author = models.IntArrayProperty(
        null=True,
        help_text=u'People that edited this entity.',
        verbose_name=u'author')
    power_generation_per_unit_in_watt = models.IntegerProperty(
        null=True,
        help_text=
        u'The amount of energy, in watts, that can be generated by each unit of the product.',
        verbose_name=u'Power generation per unit (in watts)')
    households_served = models.StringProperty(
        null=True,
        help_text=
        u'The number of households that can use the product. E.g. an oven is for 1 household, a lamp is for 0.25 households, a power plant is for (power / average household consumption in the region) households. Leave blank if you\'re unsure.',
        verbose_name=u'Households served')
    source = models.URLProperty(
        null=True,
        help_text=
        u'The URL (starting with http://) to your source. If the source is a book, enter the URL to the book at Google Books or Amazon.',
        verbose_name=u'Source')
    name = models.StringProperty(null=True, help_text=u'')
    image = models.URLProperty(
        null=True,
        help_text=u'The URL (starting with http://) where the image is hosted.',
        verbose_name=u'Image URL')
    distribution = models.Relationship(
        "Distribution",
        null=True,
        rel_type='energy_product_has_distribution+',
        help_text=
        u'A Distribution represents the batch sales or gift of a product. Companies often communicate in terms of "in year X, Y units of Product Z were sold/distributed in Country A".',
        verbose_name=u'Distribution')
    operator = models.Relationship(
        "Organization",
        null=True,
        rel_type='energy_product_has_operator+',
        help_text=
        u'Products, especially large ones such as power plants, have an Operator, usually a company.',
        verbose_name=u'Operator')
    price = models.Relationship(
        "Price",
        null=True,
        rel_type='energy_product_has_price+',
        help_text=
        u'The price (use only digits, i.e. 8.99) of the Product at the date considered.',
        verbose_name=u'Price')

    class Meta:
        verbose_name = u'Energy product'
        verbose_name_plural = u'Energy products'

    def __unicode__(self):
        return self.name or u"Unkown"
예제 #3
0
class FieldSource(models.NodeModel):
    # binding to entity
    individual = models.IntegerProperty()
    # actual source value
    reference  = models.StringProperty()
    field      = models.StringProperty()

    class Meta:
        verbose_name = u'Source'
        verbose_name_plural = u'Sources'

    def __unicode__(self):
        return self.reference or "Unkown"
예제 #4
0
class FundraisingRound(models.NodeModel):
    _topic = u'energy'
    _parent = u'Amount'
    _description = u''
    _status = models.IntegerProperty(null=True,
                                     help_text=u'',
                                     verbose_name=u'status')
    _author = models.IntArrayProperty(
        null=True,
        help_text=u'People that edited this entity.',
        verbose_name=u'author')
    currency = models.StringProperty(
        null=True,
        help_text=
        u'The currency of the amount, using its 3-letter ISO-4217 code, e.g. USD, EUR, GBP etc.',
        verbose_name=u'Currency')
    raise_type = models.StringProperty(
        null=True,
        help_text=
        u'Type of the transaction, e.g. equity contribution (cash), preproject expenses, loan.',
        verbose_name=u'Type of transaction')
    year = models.DateTimeProperty(null=True,
                                   help_text=u'',
                                   verbose_name=u'Year')
    source = models.URLProperty(
        null=True,
        help_text=
        u'The URL (starting with http://) to your source. If the source is a book, enter the URL to the book at Google Books or Amazon.',
        verbose_name=u'Source')
    units = models.IntegerProperty(null=True,
                                   help_text=u'The value of the amount.',
                                   verbose_name=u'Value')
    payer = models.Relationship(
        "Organization",
        null=True,
        rel_type='fundraising_round_has_payer+',
        help_text=
        u'The Organization that actually pays the amount or contributes the asset considered.',
        verbose_name=u'Payer')
    personal_payer = models.Relationship(
        "Person",
        null=True,
        rel_type='fundraising_round_has_personal_payer+',
        help_text=
        u'The Person that contributes the amount or the asset considered.',
        verbose_name=u'Physical payer')

    class Meta:
        pass
예제 #5
0
class Commentary(models.NodeModel):
    _topic = u'energy'
    _description = u''
    _status = models.IntegerProperty(null=True,
                                     help_text=u'',
                                     verbose_name=u'status')
    _author = models.IntArrayProperty(
        null=True,
        help_text=u'People that edited this entity.',
        verbose_name=u'author')
    year = models.DateTimeProperty(null=True,
                                   help_text=u'',
                                   verbose_name=u'Year')
    article_url = models.URLProperty(
        null=True, help_text=u'The URL (starting with http://) of the link.')
    title = models.StringProperty(
        null=True,
        help_text=u'Title of the article or report of this commentary.',
        verbose_name=u'Title')
    author = models.Relationship(
        "Person",
        null=True,
        rel_type='commentary_has_author+',
        help_text=u'The author or authors of the document.',
        verbose_name=u'Author')

    class Meta:
        pass
예제 #6
0
 class ChoiceDelete(models.NodeModel):
     poll = models.Relationship(PollDelete,
                                rel_type=neo4django.Incoming.OWNS,
                                single=True,
                                related_name='choices')
     choice = models.StringProperty()
     votes = models.IntegerProperty()
예제 #7
0
 class AnotherOrigin1(models.NodeModel):
     name = models.StringProperty()
     references = models.Relationship(
         AnotherReference1,
         rel_type=neo4django.Outgoing.REFERS_TO,
         related_name='origin',
         related_single=True)
예제 #8
0
    class Spam(models.NodeModel):
        VERY_DELICIOUS, NOT_DELICIOUS = 'v', 'n'
        DELICIOUSNESS_CHOICES = (
            ('n', 'not'),
            ('v', 'very'),
        )

        deliciousness = models.StringProperty(max_length=1,
                                              choices=DELICIOUSNESS_CHOICES)
        on_top_of = models.Relationship('Knight',
                                        related_name="spams",
                                        rel_type=neo4django.Outgoing.GOES_WITH)
예제 #9
0
class Country(models.NodeModel):
    _description = u''
    _status = models.IntegerProperty(null=True,
                                     help_text=u'',
                                     verbose_name=u'status')
    _author = models.IntArrayProperty(
        null=True,
        help_text=u'People that edited this entity.',
        verbose_name=u'author')
    name = models.StringProperty(null=True, help_text=u'')
    isoa3 = models.StringProperty(
        null=True,
        help_text=
        u'The 3-letter ISO code for the country or territory (e.g. FRA for France, DEU for Germany etc.)',
        verbose_name=u'ISO alpha-3 code')

    class Meta:
        verbose_name = u'Country'
        verbose_name_plural = u'Countries'

    def __unicode__(self):
        return self.name or u"Unkown"
예제 #10
0
class Distribution(models.NodeModel):
    _topic = u'energy'
    _parent = u'Amount'
    _description = u''
    _status = models.IntegerProperty(null=True,
                                     help_text=u'',
                                     verbose_name=u'status')
    _author = models.IntArrayProperty(
        null=True,
        help_text=u'People that edited this entity.',
        verbose_name=u'author')
    sold = models.StringProperty(
        null=True,
        help_text=u'The type of distribution can be donated, sold, loaned.',
        verbose_name=u'Type of distribution')
    year = models.DateTimeProperty(null=True,
                                   help_text=u'',
                                   verbose_name=u'Year')
    source = models.URLProperty(
        null=True,
        help_text=
        u'The URL (starting with http://) to your source. If the source is a book, enter the URL to the book at Google Books or Amazon.',
        verbose_name=u'Source')
    units = models.IntegerProperty(null=True,
                                   help_text=u'The value of the amount.',
                                   verbose_name=u'Value')
    activity_in_country = models.Relationship(
        Country,
        null=True,
        rel_type='distribution_has_activity_in_country+',
        help_text=
        u'The list of countries or territories the entity is active in. ',
        verbose_name=u'Active in countries')

    class Meta:
        pass
예제 #11
0
 class LetterN(models.NodeModel):
     name = models.StringProperty()
     follows = models.Relationship(LetterM, rel_type='follows')
예제 #12
0
 class CountingChoice(models.NodeModel):
     poll = models.Relationship(CountingPoll,
                                rel_type=neo4django.Incoming.OWNS,
                                single=True,
                                related_name='choices')
     choice = models.StringProperty()
예제 #13
0
    class Student(models.NodeModel):
        name = models.StringProperty()

        def __str__(self):
            return self.name
예제 #14
0
class Stock(models.NodeModel):

    name = models.StringProperty()
    ltp = FloatProperty()
예제 #15
0
class EnergyProject(models.NodeModel):
    _topic = u'energy'
    _description = u'An energy Project represents an endeavor to reach a particular aim (e.g. improve access to electricity, produce electricity in a certain way, improve energy efficiency, etc.). A project is the child of an Organization and takes its concrete form most often through Products.'
    _status = models.IntegerProperty(null=True,
                                     help_text=u'',
                                     verbose_name=u'status')
    _author = models.IntArrayProperty(
        null=True,
        help_text=u'People that edited this entity.',
        verbose_name=u'author')
    source = models.URLProperty(
        null=True,
        help_text=
        u'The URL (starting with http://) to your source. If the source is a book, enter the URL to the book at Google Books or Amazon.',
        verbose_name=u'Source')
    twitter_handle = models.StringProperty(
        null=True,
        help_text=u'The Twitter name of the entity (without the @)',
        verbose_name=u'Twitter handle')
    ended = models.DateTimeProperty(
        null=True,
        help_text=u'The date when the project or organization ended.',
        verbose_name=u'End date')
    started = models.DateTimeProperty(
        null=True,
        help_text=
        u'Date when the project was started. Can be anterior to the date when the parent organization was created.',
        verbose_name=u'Start date')
    comment = models.StringProperty(
        null=True,
        help_text=
        u'Enter a short comment to the entity you are reporting on (max. 500 characters).',
        verbose_name=u'Comment')
    image = models.URLProperty(
        null=True,
        help_text=u'The URL (starting with http://) where the image is hosted.',
        verbose_name=u'Image URL')
    name = models.StringProperty(null=True, help_text=u'')
    product = models.Relationship(
        "EnergyProduct",
        null=True,
        rel_type='energy_project_has_product+',
        help_text=
        u'A Product represents the concrete emanation of an energy Project. It can be a mass-produced device or a power plant.'
    )
    partner = models.Relationship(
        "Organization",
        null=True,
        related_name="partner_projects ",
        rel_type='energy_project_has_partner+',
        help_text=
        u'An entity can have Partners, i.e. Organizations that help without making a financial contribution (if financial or substancial help is involved, use Fundraising Round instead).'
    )
    commentary = models.Relationship(
        "Commentary",
        null=True,
        rel_type='energy_project_has_commentary+',
        help_text=
        u'A Commentary is an article, a blog post or a report that assesses the quality of the Project.'
    )
    activity_in_country = models.Relationship(
        Country,
        null=True,
        rel_type='energy_project_has_activity_in_country+',
        help_text=
        u'The list of countries or territories the entity is active in. ')
    owner = models.Relationship("Organization",
                                null=True,
                                rel_type='energy_project_has_owner+',
                                help_text=u'The formal Owner of the entity.')

    class Meta:
        verbose_name = u'Energy project'
        verbose_name_plural = u'Energy projects'

    def __unicode__(self):
        return self.name or u"Unkown"
예제 #16
0
    class PollIdx(models.NodeModel):
        question = models.StringProperty()

        def __unicode__(self):
            return self.question
예제 #17
0
 class IndexedParent(models.NodeModel):
     name = models.StringProperty(indexed=True)
예제 #18
0
class Order(models.NodeModel):

    trader = models.Relationship(User, rel_type='owns', related_name='orders')
    _type = models.StringProperty(max_length=4)
    quantity = models.IntegerProperty()
    amount = FloatProperty()
예제 #19
0
 class Stalker(models.NodeModel):
     name = models.StringProperty()
     person = models.Relationship(Person,
                                  rel_type=neo4django.Outgoing.POINTS_TO,
                                  single=True,
                                  related_single=True)
예제 #20
0
class User(models.NodeModel):

    username = models.StringProperty()
    email = models.EmailProperty()
    fund_balance = FloatProperty()
예제 #21
0
 class CountingPoll(models.NodeModel):
     question = models.StringProperty()
예제 #22
0
class EmployedPerson(Person):
    job_title = models.StringProperty(indexed=True)
예제 #23
0
 class PollDelete(models.NodeModel):
     question = models.StringProperty()
예제 #24
0
class Person(models.NodeModel):
    name = models.StringProperty()
    age = models.IntegerProperty()

    friends = models.Relationship('self', rel_type='friends_with')
예제 #25
0
 class LetterL(models.NodeModel):
     name = models.StringProperty()
예제 #26
0
 class Doppelganger(models.NodeModel):
     name = models.StringProperty()
     original = models.Relationship(Person,
                                    rel_type=neo4django.Outgoing.MIMICS,
                                    single=True)
예제 #27
0
 class Topic(models.NodeModel):
     value = models.StringProperty()
예제 #28
0
 class NameOwner(models.NodeModel):
     name = models.StringProperty()
     confidantes = models.Relationship(Person, neo4django.Outgoing.KNOWS)
예제 #29
0
 class Origin2(models.NodeModel):
     name = models.StringProperty()
예제 #30
0
 class DatedPaper(models.NodeModel):
     name = models.StringProperty()
     date = models.DateProperty()
     datetime = models.DateTimeProperty()