def __lt__(self, other):
if isinstance(other, self.__class__):
- return self.parent_id == other.id
+ return self.priority > other.priority or self.name < other.name
return NotImplemented
- @lazy_property
- def next(self):
- return self.backend.repos._get_repository("SELECT * FROM repositories \
- WHERE parent_id = %s", self.id)
-
- @lazy_property
- def parent(self):
- if self.data.parent_id:
- return self.backend.repos._get_repository("SELECT * FROM repositories \
- WHERE id = %s", self.data.parent_id)
-
@lazy_property
def distro(self):
return self.backend.distros.get_by_id(self.data.distro_id)
description = property(get_description, set_description)
- @property
- def parent_id(self):
- return self.data.parent_id
-
# Key Management
@lazy_property
slug text,
description text DEFAULT ''::text NOT NULL,
distro_id integer NOT NULL,
- parent_id integer,
key_id integer NOT NULL,
mirrored boolean DEFAULT false NOT NULL,
updated_at timestamp without time zone,
ADD CONSTRAINT repositories_owner_id FOREIGN KEY (owner_id) REFERENCES public.users(id);
---
--- Name: repositories repositories_parent_id; Type: FK CONSTRAINT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.repositories
- ADD CONSTRAINT repositories_parent_id FOREIGN KEY (parent_id) REFERENCES public.repositories(id);
-
-
--
-- Name: repository_builds repository_builds_added_by; Type: FK CONSTRAINT; Schema: public; Owner: -
--