I have this code here, that I would like to initiate a Many to many connection with, I have the associations set. I do not have foreign keys, as from what I read that is not needed. Where I am stuck here, is how to actually connect the “book” to the “library”. I really would like someone to teach me how to do this instead of just giving me the answer, if that is all possible? Link to the Repo: https://github.com/Corey-Miller85/ManyToMany, The guide I am using to try to teach myself this is, https://sequelize-guides.netlify.com/many-many-associations/
The main part where I get stuck adding a book to the library, according to this article I should now have a method that would allow me to use “Library.addBook()” I have tried this, “Book.addLibrary” and so on with no luck. Does anyone have somewhere I can learn this better, or have someone explain it to me?
why do you think you don't have to set up any keys or foreign keys exactly? Plus this is an issue... when you use as: library_Book and name it the same on both sides of the relationship.. that doesn't really make good sense... in Book the as might make more sense like as: LibrariesForBook and in Library maybe something like as:BooksInLibrary so that your getters make sense... i think you should set up your primary keys and foreign keys and get the parent create working with models.Book.create() or whatever.. and then come back and show what you've done and we can help out with the include for that or another working method
Related
We currently have Two Factor Authentication working in the 2017_2 release of the NetSuite PHP Toolkit, but we have some code that has broken due to changes between 2015_2 and 2017_2. It seems that in 2017_2 it is also far easier to set up Two Factor Authentication.
Looking at the code, however I do see references to TokenPassport and TokenPassportSignature, which tells me that I should be able to get TBA working in 2015_2, which would give us time to figure out the rest of the issues.
My question is: How would I actually go about that? I have set $service->passport to the generated TokenPassport object. I know that my TokenPassport object works in 2017_2, and I assume it would be the same, but I don't know for sure, and I can't seem to find any information up on Elgoog.
ETA: I have seen examples of this working in 2015_2 in Ruby, but not in PHP. The backend is there, but I can't seem to be able to do this in PHP, and the Ruby examples were only snippets.
Okay, so I solved this for myself, but I may not have done it the "right" way. Here's what I did:
I took the makeSoapCall and setTokenGenerator methods from the new instance of NSPHPClient.php, and I added them to the OLD version. I had to modify the setTokenGenerator method to not require an instance of iTokenPassportGenerator, but I could have just as easily copied over that interface as well.
Basically, all that needs to happen is that we need to send the tokenPassport header, which the older version of the SDK can generate but doesn't have a method to actually send that I could find.
I'm just trying to find a way to access the name property of an Area element inside Revit Python Shell, tried looking on Jeremy Tammik's amazingly informative blog, tried AUGI, Revit API docs, been looking for 2 days now...
Tried accessing via a bunch of ways, FilteredElementsCollector(doc).OfCategory(BuiltInCategory.OST_Areas), tried by Area class, tried through AreaTag, every single time I get an error under every circumstance and it's driving me nuts, it seems like such a simple issue that I can't seem to grasp!
EDIT: Also tried by element id, through tags, through area schemes, nada, no go...
Can anyone please tell me how to access this property via RPS?
I would say two things:
areaObject.LookupParameter("Name")
areaObject.GetParameters("Name")
...are valid methods. Please notice how I used GetParameters() NOT GetParameter(). There are some drawbacks to using either one of the two. The lookup method will return FIRST parameter that matches the name which in many cases might be a different parameter for different elements. It's not very reliable.
GetParameters() method will return them all if there are multiple so then you have to deal with a List<Parameter> rather than a single object that you can extract your value from.
I would personally recommend to use areaObject.get_Parameter(BuiltInParameter.ROOM_NAME) method to extract a Name value from Area object. The BuiltInParameter always points at the same parameter, and will reliably return just that one parameter. Here's a little more details about these methods:
http://www.revitapidocs.com/2018/4400b9f8-3787-0947-5113-2522ff5e5de2.htm
To answer my own question, I actually never thought of looking through the code of other Revit Python scripts... in this case of PyRevit, which is in my opinion far more eloquently written than RPS, raelly looking forward for their console work to be done!
Basically, I had mistakenly used GetParameter('parameter') instead of LookupParameter('parameter').
As I said, it was something stupidly simple that I just didn't understand.
If anyone has sufficient knowledge to coherently clarify this, please do answer!
Many thanks!
Maybe your issue is the same as this one ? :
https://groups.google.com/forum/#!searchin/RevitPythonShell/name|sort:relevance/revitpythonshell/uaxB1FLXG80/sdJNrTfoPuUJ
Your_Area.Name # throws error
Element.Name.GetValue(Your_Area) # works great
I think I need to use the "isOverflown" ( probably set as "true" ) and "overflownDIV" ( probably set to some DIV selector ). These options are specified on this blog post. Has anyone used these options? I can see it in the source code, but I cannot get it to work. I think I am setting "overflownDIV" to the wrong value. Any examples would be much appreciated.
As per another post, I am trying to get the scrolling to work correctly and I believe these two options are meant to help with that.
EDIT:
I believe, based on the reference to isOverflown being deprecated, that overflownDIV is also deprecated.
Underneath the "demos" directory, there are a bunch of helpful examples.
One such example is for the "overflownDIV" situation ( demoOverflown.html ). But I actually don't think it does anything. I don't think it does anything because, in the code for the engine itself ( jquery.validationEngine.js ), and the debugger, it won't get to that part of the code unless "isOverflown" is true, and since isOverflown is false, we never get into that part of the code for the demo. There is no reference to "isOverflown" at all under "demos". In fact, the only reference is in jquery.validationEngine.js. As such, it seems that that feature has been deprecated. If anyone disagrees, please tell me.
Thanks.
A better way to solve this type of issue can be seen here, especially since isOverflown seems to have been deprecated.
Is it possible to modify the order of the intellisense options shown when I hit ctrl-space?
Specifically, I'd like to order them in scope, so that if I have a variable in my function that matches what I've typed so far then it goes to the top of the list. If there's a member in the class, that's next, etc. I'm just kind of sick of having to type enough that I don't match some random global symbol in Windows' crypto libraries or whatever.
Is this kind of this possible? Where do I start? I looked for an obvious option in vs2010, but didn't find anything.
My programming language is native c++.
Here's what I've found so far.
A walkthrough showing how to add items to the intellisense popup: http://msdn.microsoft.com/en-us/library/ee372314.aspx
The walkthrough uses the ICompletionSession interface:
http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.language.intellisense.icompletionsession.aspx
It looks as if you might be able to clear the CompletionSets, and replace them with your own completion sets, but I'm not sure if there's any way to change the order, or if they are always sorted. There is the IIntellisensePresenter interface, but it looks like it's pretty much empty.
Also, from the walkthrough, it looks like you can fill the CompletionSets with a dumb list of strings, so you'd need some other way of interrogating the symbols to determine scope, which may not always be possible.
In short: Probably not possible at the moment.
Figured it out. LVIF_STATE should have been LVIF_IMAGE. See, I knew it was elementary...
I have a CListView derived class with an OnDoubleClick() handler in a VC++6.0 project. I need to persist the highlighting of the selected item after the OnDoubleClick() handler has done its thing. I had thought that
GetListCtrl().SetItemState(m_nHighlightIndex,LVIS_SELECTED, LVIF_STATE);
would do the trick (assuming that m_nHighlightIndex holds the index of the selected item), but no combination of that and various attempts to invalidate the client area has worked, in either OnDoubleClick() or OnUpdate(). This seems like such an elementary thing to do, but thus far it baffles me. Any help would be greatly appreciated.
Just so it looks answered (and apologies if this is bad form):
LVIF_STATE should have been LVIF_IMAGE. See, I knew it was elementary...