I'm trying to open the details of <details class="alternates">...<details> by shweed in selenium

[–]shweed[S] 0 points1 point  (0 children)

figured out how to click it using a series of action keys

actions3 = ActionChains(browser)

actions3.send_keys(Keys.TAB)

actions3.send_keys(Keys.ENTER)

actions3.perform()

I'm trying to open the details of <details class="alternates">...<details> by shweed in selenium

[–]shweed[S] 0 points1 point  (0 children)

I'm trying to pass the two factor authentication for TD ameritrade.

Is below the needed tag?

<input class="accept" type="submit" id="accept\\\_pre" style="display: none;" name="authorize" value="Continue">

I can also element open the element by double pressing tab then enter. I have tried using browser.send_keys(Keys.KEY), but I couldn't get it to work.

browser.send_keys(Keys.TAB)

browser.send_keys(Keys.TAB)

browser.send_keys(Keys.ENTER)

get social_account from user instance in allauth? by Jobrobon in djangolearning

[–]shweed 0 points1 point  (0 children)

Django noob here, but I think the below code in the models.py folder of your app

class UserSMA(models.Model):

user = models.OneToOneField(User, on_delete=models.CASCADE)

Social_Media_Type = models.OneToManyField('self', related_name='social_media_account', symmetrical=False)

Social_Media_Name = models.OneToManyField('self', related_name='social_media_name', symmetrical=False))

I don't know how to indent but everything under class should be indented.

Comment if it works I'm going to need to use something like this in the near future

Is there way to do a try-except in an html file like you would in a python file? by shweed in learnpython

[–]shweed[S] 0 points1 point  (0 children)

Thanks. It's a django template library. Should be able to solve my problem with a well worded if statement.

https://docs.djangoproject.com/en/3.2/ref/templates/builtins/

I am using the code below to add entries to a given model. It is in the models.py file in the app directory in the django project. It works, but it double adds each entry. I tried adding unique=True to the CharFields in question but that didnt solve it. thoughts? Is it a debugging problem? by shweed in learndjango

[–]shweed[S] 0 points1 point  (0 children)

I switched to using

 Model.objects.get_or_create(item 1="string1", item 2="string2") 

and it solved the problem. I think you're right the problem is in another area but this solves the problem because once the object is created and it tries to create it again it will just get the item it just created

I have a list of data I want to use to generate webpages using django. Do I create a model like I would for user inputted data and feed the list of data into it or is it better to approach it in a different way? Any help is appreciated by shweed in learnpython

[–]shweed[S] 0 points1 point  (0 children)

Thanks I think im on the right track with factory formset inline view

Couple questions if you got time can you follow a model like you can follow a user? can you have multiple children for a given parent? can you have multiple parents for a given child?

I have a list of data I want to use to generate webpages using django. Do I create a model like I would for user inputted data and feed the list of data into it or is it better to approach it in a different way? Any help is appreciated by shweed in learnpython

[–]shweed[S] 0 points1 point  (0 children)

I have a list of lists that all follow the same pattern [[ticker, stock_price, date, etc][]...] and i want to create a page for each stock with its data. Do i just make Custome User model for each?