Git Product home page Git Product logo

Comments (7)

euanwho avatar euanwho commented on August 28, 2024

Maybe Affiliation would be a better name for it. That is what Wookiepedia calls it.

from swapi.

jhdoak avatar jhdoak commented on August 28, 2024

Might be good to put affiliations in an array to accommodate for those who have defected/changed affiliation at some point and would need multiple entries.

from swapi.

euanwho avatar euanwho commented on August 28, 2024

Sounds good. The affiliations that a person has defected from will have (formerly) afterwards.
The affiliations I am thinking of are these:

  • Separatist State
  • Jedi Order
  • Galactic Republic
  • Order of Sith Lords
  • Galactic Empire
  • New Republic
  • Rebel Alliance
  • First Order
  • Resistance
  • Hutt Clan
  • Luke Skywalker's Jedi

What do you think?

from swapi.

jhdoak avatar jhdoak commented on August 28, 2024

Looks like a solid list! My only question with that is, how do we determine what affiliation is "current"? For example, a character from SWRebels could have one "current" affiliation in the show (and have an arc that hasn't resolved), but then could hypothetically show up in a future movie with another "current" affiliation. When you think about it, everything in SW happened "a long, long time ago", so it might be cleaner not to list any as formerly.

To me the solution depends on how in depth we want to get. The simple solution would be to just list all affiliations without indicating "formerly" or anything like that. A more complicated solution would be something along the lines of giving each affiliation a rough year range for when they held that affiliation, or associating their affiliation with major events (for example, Anakin could be listed as being affiliated with the Jedi order up through the clone wars).

Not sure what the best solution is, just some thoughts.

from swapi.

euanwho avatar euanwho commented on August 28, 2024

I think you are right. I was thinking of giving Han Solo an affiliation with Hutt Clan, then saying formerly. But I think that it might be clearer just to leave it off. I think that the complicated solution will be too complicated, I am willing to put the basic affiliations in and if someone wants to do that then they are welcome.

One question, how do I update models.py to show that Affiliations is an array. For instance, name is a string and it is written like this: name = models.CharField(max_length=100)

I am not sure how to do this.

from swapi.

jhdoak avatar jhdoak commented on August 28, 2024

Yeah I agree, going the simple route is probably best. As far as your question with models.py, I can't help ya there. Hopefully someone else chimes in.

from swapi.

phalt avatar phalt commented on August 28, 2024

@jhdoak Use the date 0 ABY (After the Battle of Yavin, or the episode 4) for the "currentness".

@euanwho You want to make a relationship between a character and a new model called affiliation. The character should have a foreign key to affiliation (because an affiliation can have many characters, but a character can only have one affiliation) See the Django documentation: https://docs.djangoproject.com/en/1.10/ref/models/fields/#foreignkey

from swapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.