Election results in the London Borough of Sutton.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

models.rb 1.2 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. class Postcode
  2. include DataMapper::Resource
  3. property :id, Serial
  4. property :postcode, String, :required => true
  5. property :created_at, DateTime
  6. property :lat, Float
  7. property :lng, Float
  8. property :district_name, String
  9. property :district_code, String
  10. property :ward_name, String
  11. property :ward_code, String
  12. end
  13. class Ward
  14. include DataMapper::Resource
  15. property :id, Serial
  16. property :ons_id, String, :required => true
  17. property :name, String, :required => true
  18. has n, :councilcandidates
  19. end
  20. class Party
  21. include DataMapper::Resource
  22. property :id, Serial
  23. property :name, String, :required => true
  24. has n, :councilcandidates
  25. end
  26. class Councilcandidate
  27. include DataMapper::Resource
  28. property :id, Serial
  29. property :ward_id, Integer, :required => true
  30. property :party_id, Integer, :required => true
  31. property :forenames, String
  32. property :surname, String
  33. property :address, String, :length => 200
  34. property :postcode, String
  35. belongs_to :party
  36. belongs_to :ward
  37. end