Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Benjamin Kampmann
@gnunicorn
yes
alright. bed time now :)
you good for now?
otherwise write stuff and I’ll answer it first thing tomorrow morning.
Ethan Miller
@ezmiller
Yes, I think I need to chew on that a bit.
thanks!
Benjamin Kampmann
@gnunicorn
it is complex, so take your time :)
Night!
Ethan Miller
@ezmiller
Nigthy night.Thursday still works?
Ethan Miller
@ezmiller
Some additional questions, more specific:
Benjamin Kampmann
@gnunicorn
morning.
yes, thrusday is still scheduled for me.
Ethan Miller
@ezmiller
1) You said above that I should a) add a meta tag to my new object and b) register it with the ObjectField registry. What’s confusing me a bit, though, is that I’m not really using a new object, just the existing LinkSchema copied over from the hacker news site. All I’ve done there is just assign an instance of it to a new variable with the many flag set: links = LinkSchema(many=True). Then in the views.py, I’d imported links as links_schema, and used that to process what is returned to the client.
2) I think one thing that might be going wrong here is that I’m basically bypassing that chain we discussed yesterday (i.e. query.pagination() -> PaginationSChema -> MorphingSchema -> (target schema)). Is that right? This is perhaps why the data that’s being sent to the client is off: because it’s just the target schema essentially, and hasn’t been wrapped by the PaginationSchema? Am I on the right track?
3) So is the right thing to do here to have my view for the /links/ route return in a way that resembles what you’ve got in that /latest view? I.e. feed a query = Object.query to objects_paged.dump() imported from beavy.models.object, passing it through the as_page() method?
Looking forward to Thursday!
Benjamin Kampmann
@gnunicorn
hacker_news wasn’t completed yet. doesn’t look like I finished that part.
the basic (later) idea would be to have a bunch of listing views which are global and you only configure your LinkObject to be included in them in a specific way (via the Object-Capabilities)
you’d still very much need a Schema though.
but to answer your question, yes, you don’t use the pagination-system supplied at the moment.
I am not certain that is causing that particular bug, but I recommend staying in that chain, to get all the benefits provided.
Ethan Miller
@ezmiller
Huh. Okay. Perhaps, then, I should think of this as a merge into Beavy and work on the global solution of having listing views. The interaction between the back end and the front here is still a confusing area here where I have a lot to learn and that sounds like a good exercise.
Benjamin Kampmann
@gnunicorn
sounds good :)
Benjamin Kampmann
@gnunicorn
\o/ was able to login!
gotta do some committing!
Ethan Miller
@ezmiller
what was preventing you from logging in?
Benjamin Kampmann
@gnunicorn
my rewrite :D
beavyHQ/beavy#37
Ethan Miller
@ezmiller
AAhhh. Good idea by the way.
Benjamin Kampmann
@gnunicorn
what is?
the persona system?
Ethan Miller
@ezmiller
Yes.
Benjamin Kampmann
@gnunicorn
yeah. I strongly think so. it was one of the major shortcomings of most systems.
(like … discourse. no difference between their system-bot and any logged in person – is just awkward.)
though I am sure this will come a with a range of other complications :D
Ethan Miller
@ezmiller
what doesn’t!
Benjamin Kampmann
@gnunicorn
ahaha! yes, that's the spirit!
Benjamin Kampmann
@gnunicorn
@ezmiller I’m adding some tests, because this persona stuff is complex and easy to mess with.
those are tests in between the total unit-tests and the functional tests we had before – running a fake app context
(with a database and all)
Ethan Miller
@ezmiller
Okay, look forward to seeing them on the PR>
Benjamin Kampmann
@gnunicorn
if you want to do some tests for the pagination, I think that’d be a great way to not only ensure you are understanding what is happening but also to make sure it stays that way :D
Benjamin Kampmann
@gnunicorn
pushed. here is an example – beavyHQ/beavy@aab2581
Benjamin Kampmann
@gnunicorn
and having tests already fixed a bug in my implementation beavyHQ/beavy@3784598 \o/
Ethan Miller
@ezmiller
Sounds like a good idea. I was thinking about testing the schema the other day to see how things were working.
Regarding test location: I saw you put those in beavy/tests
What’s our guide here?
Though I read in the docs that you suggested putting them in the same location as the file being tested...
Benjamin Kampmann
@gnunicorn
well. so. I think pytest looks in a tests/ folder for the configtest.py, that’s why I did that.
that previous suggestion was for very small tests of only that one module, that’s where that idea originated from. the tests I just added are multi-module, more complex tests, and I didn’t want them messing in the normal code base
I can the argument of moving everything into the tests subfolder. though for beavy_modules and apps that might be overkill. everything ending with “test.py” will be found anyways.
Benjamin Kampmann
@gnunicorn
one argument I could see for having a top-level tests/ folder is because we could exclude those from the deploy easily. However – this is neglectable size so, what would be the point?