These are chat archives for django/django

Oct 2017
Oct 17 2017 01:08
@phillip94 for question one.. what does your company model look like?
Oct 17 2017 01:25
Fyi, @LukeVideo , if say you wanted to get a person with a specific attribute, you could do something like User.objects.filter(last_name='smith')
If you extend you user model with a one-to-one field, then you could do something like User.objects.filter(profile__logged_in__range=[start, end])
Oct 17 2017 07:14
I'm getting a migration error when running test so I decided to disable migrations for tests. I learned many people asked for this featured (disabling migrations when testing) because it's slowed the process considerably. But I wonder, if Django runs migrations when testing there must be a reason for it right? Could disabling migrations cause any problems?
Oct 17 2017 08:13
@flyboy1565 Thanks, you are answering my query set related question right ? That's not about could that be used to redirect to the current page with a updated template? I'm having an issue where I only get the penultimate submission to show up after a form submission. As soon as I hit f5 I get my last submission as expected.
Oct 17 2017 12:03
CommandError: You appear not to have the 'mysql' program installed or on your path.
How to encounter this error, please help me out.
Oct 17 2017 13:43
In your the database to use is specified. Did you install your project on a new machine? Or did you perhaps git clone a Django project? You will have to install MySQL on your server or change your settings to fit your environment
For development purpose you can use SQLite
Oct 17 2017 14:28
@flyboy1565 I was able to figure out Q1, I used if ( - datetime.timedelta(days=7)) > company.people_updated: get_company_details(stock_symbol) where get_company_details is a function I imported.
Oct 17 2017 19:20
@phillip94, if you second model looks like
class Person(models.Model):
     company = models.ForeignKey(company)
     name = models.CharField()
     date_added = models.DateField()

# then you could do 
It would mean you'd have a database of the people that would be add during your scraping. The page would only render the data from the database
Oct 17 2017 19:46
@flyboy1565 that will work, thanks for the help!