Esempio n. 1
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"
Esempio n. 2
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
Esempio n. 3
0
 class Reference2(models.NodeModel):
     origin = models.Relationship(
         Origin2,
         rel_type=neo4django.Outgoing.REFERS_TO,
         #TODO explore edge direction here, this is wrong
         related_name='references',
         single=True)
Esempio n. 4
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
Esempio n. 5
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()
Esempio n. 6
0
 class MovieCredits(models.NodeModel):
     actors = models.Relationship(
         Actor,
         rel_type=neo4django.Incoming.ACTS_IN,
         related_name='movies',
         preserve_ordering=True,
     )
Esempio n. 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)
Esempio n. 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)
Esempio n. 9
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
Esempio n. 10
0
 class Stalker(models.NodeModel):
     name = models.StringProperty()
     person = models.Relationship(Person,
                                  rel_type=neo4django.Outgoing.POINTS_TO,
                                  single=True,
                                  related_single=True)
Esempio n. 11
0
 class CountingChoice(models.NodeModel):
     poll = models.Relationship(CountingPoll,
                                rel_type=neo4django.Incoming.OWNS,
                                single=True,
                                related_name='choices')
     choice = models.StringProperty()
Esempio n. 12
0
 class Child1(models.NodeModel):
     parents = models.Relationship(Person, 'CHILD1_OF')
Esempio n. 13
0
 class Child(models.NodeModel):
     parents = models.Relationship('neo4django.Person',
                                   neo4django.Outgoing.CHILD_OF)
Esempio n. 14
0
 class Reference1(models.NodeModel):
     origin = models.Relationship(Origin1,
                                  rel_type=neo4django.Outgoing.REFERS_TO,
                                  related_name='references',
                                  single=True)
Esempio n. 15
0
 class LetterN(models.NodeModel):
     name = models.StringProperty()
     follows = models.Relationship(LetterM, rel_type='follows')
Esempio n. 16
0
 class SomeOtherPaper(models.NodeModel):
     authors = models.Relationship(
         Person,
         rel_type=neo4django.Outgoing.OTHER_OWNED_BY,
         related_name='papers')
Esempio n. 17
0
 class NameOwner(models.NodeModel):
     name = models.StringProperty()
     confidantes = models.Relationship(Person, neo4django.Outgoing.KNOWS)
Esempio n. 18
0
 class Doppelganger(models.NodeModel):
     name = models.StringProperty()
     original = models.Relationship(Person,
                                    rel_type=neo4django.Outgoing.MIMICS,
                                    single=True)
Esempio n. 19
0
class Person(models.NodeModel):
    name = models.StringProperty()
    age = models.IntegerProperty()

    friends = models.Relationship('self', rel_type='friends_with')
Esempio n. 20
0
class Pet(models.NodeModel):
    owner = models.Relationship(Person,
                                rel_type='owns',
                                single=True,
                                related_name='pets')
Esempio n. 21
0
 class FriendlyPerson(Person):
     friends = models.Relationship('self', rel_type='friends_with')
Esempio n. 22
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()
Esempio n. 23
0
    class ZenNode(models.NodeModel):
        class Meta:
            abstract = True

        rel = models.Relationship('self', rel_type='knows')
Esempio n. 24
0
class Organization(models.NodeModel):
    _topic = u'energy'
    _description = u'An Organization represents a social entity that implements, funds, takes part in or helps a Project. It can be an NGO, a university, a governement organization, a for-profit company or an international organization.'
    _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')
    founded = models.DateTimeProperty(
        null=True,
        help_text=u'The date when the organization was created.',
        verbose_name=u'Date founded')
    company_type = models.StringProperty(
        null=True,
        help_text=
        u'If the organization is a company, type of company (e.g. limited liability company, public corporation, unlimited company etc.)',
        verbose_name=u'Company type')
    company_register_link = models.URLProperty(
        null=True,
        help_text=
        u'The URL (starting with http://) to the official company register where the organization is registered.',
        verbose_name=u'Company register link')
    twitter_handle = models.StringProperty(
        null=True,
        help_text=u'The Twitter name of the entity (without the @)',
        verbose_name=u'Twitter handle')
    website_url = models.URLProperty(null=True,
                                     help_text=u'',
                                     verbose_name=u'Website URL')
    name = models.StringProperty(null=True, help_text=u'')
    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')
    address = models.StringProperty(
        null=True,
        help_text=u'The official address of the organization.',
        verbose_name=u'Address')
    organization_type = models.StringProperty(
        null=True,
        help_text=
        u'Type of organization. Can be Company, Government Organization, International Organization, University or NGO',
        verbose_name=u'Organization type')
    image = models.URLProperty(
        null=True,
        help_text=u'The URL (starting with http://) where the image is hosted.',
        verbose_name=u'Image URL')
    office_address = models.StringProperty(
        null=True,
        help_text=
        u'The address or addresses where this organization does business. Do add the country at the end of the address, e.g. Grimmstraße 10A, 10967 Berlin, Germany.',
        verbose_name=u'Office address')
    adviser = models.Relationship(
        "Person",
        null=True,
        rel_type='organization_has_adviser+',
        help_text=u'The list of persons that help the entity.',
        verbose_name=u'Adviser')
    revenue = models.Relationship(
        "Revenue",
        null=True,
        rel_type='organization_has_revenue+',
        help_text=
        u'A Revenue represents the quantity of cash that the Organization was able to gather in any given year. It doesn\'t have to be equal to the net sales but can take into account subsidies as well.',
        verbose_name=u'Revenue')
    board_member = models.Relationship(
        "Person",
        null=True,
        rel_type='organization_has_board_member+',
        help_text=u'The list of board members of the Organization, if any.',
        verbose_name=u'Board member')
    partner = models.Relationship(
        "self",
        null=True,
        rel_type='organization_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).',
        verbose_name=u'Partner')
    key_person = models.Relationship(
        "Person",
        null=True,
        rel_type='organization_has_key_person+',
        help_text=
        u'A Key Person is an executive-level individual within an Organization, such as a CEO, CFO, spokesperson etc.',
        verbose_name=u'Key Person')
    litigation_against = models.Relationship(
        "self",
        null=True,
        rel_type='organization_has_litigation_against+',
        help_text=
        u'An entity is said to litigate against another when it is involved in a lawsuit or an out-of-court settlement with the other.',
        verbose_name=u'Litigation against')
    fundraising_round = models.Relationship(
        "FundraisingRound",
        null=True,
        rel_type='organization_has_fundraising_round+',
        help_text=
        u'A Fundraising Round represents an event when an Organization was able to raise cash or another asset.',
        verbose_name=u'Fundraising round')
    monitoring_body = models.Relationship(
        "self",
        null=True,
        rel_type='organization_has_monitoring_body+',
        help_text=
        u'The Monitoring Body is the organization that is responsible for overseeing the project. In the case of electricity projects, it is often the national electricity regulator.',
        verbose_name=u'Monitoring body')

    class Meta:
        verbose_name = u'Organization'
        verbose_name_plural = u'Organizations'

    def __unicode__(self):
        return self.name or u"Unkown"
Esempio n. 25
0
 class TOC(models.NodeModel):
     contains = models.Relationship(Topic,
                                    rel_type='follows',
                                    preserve_ordering=True)
Esempio n. 26
0
 class NodeWithRelMetadata(models.NodeModel):
     contacts = models.Relationship(Person,
                                    rel_type=neo4django.Outgoing.KNOWS_1,
                                    metadata={'test': 123})
Esempio n. 27
0
 class ConflictedModel(models.NodeModel):
     first_rel = models.Relationship(
         'self', rel_type=neo4django.Outgoing.CONFLICTS_WITH)
     second_rel = models.Relationship(
         'self', rel_type=neo4django.Outgoing.CONFLICTS_WITH)
Esempio n. 28
0
 class MetaNode(models.NodeModel):
     myself = models.Relationship('self',
                                  'IS',
                                  single=True,
                                  related_name='myselves')
Esempio n. 29
0
 class Classroom(models.NodeModel):
     students = models.Relationship('Student',
                                    rel_type=neo4django.Outgoing.COMES_TO,
                                    related_name="school")
Esempio n. 30
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"