question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problems with postgres fields

See original GitHub issue

Django now supports postgres fields like ArrayField, JSONField, HStoreField etc.

https://docs.djangoproject.com/en/1.9/ref/contrib/postgres/fields/

seed management command as well as seeder.add_entity fails since they are not been detected with FieldTypeGuesser.

It would be great to have this support at least at the add_entity level.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
AngelOnFiracommented, Aug 4, 2020

Ok, this should be resolved to at least not fail. #77 catches model types that do not have a guesser but does have a _default_hint (here is the line), and #80 allows you to pass a dict of objects that won’t be handled by the guesser:

seeder.add_entity(Player, 10, {
    'score':    lambda x: random.randint(0, 1000),
    'nickname': lambda x: seeder.faker.email(),
})
seeder.execute()

I’m going to close this issue, but please reopen if extra functionality is needed! 😃

0reactions
AngelOnFiracommented, Jul 22, 2020

@diego-capyba I’ll see if I can take a look at this in the next week or so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Common Problems with PostgreSQL - Zapier
Existing columns causing an error when using Custom Query. Double-check if your column names contain any uppercase characters. This will cause ...
Read more >
Don't Do This - PostgreSQL wiki
A short list of common mistakes. Kristian Dupont provides schemalint a tool to verify the database schema against those recommendations.
Read more >
Postgres alter column problems and solutions - End Point Dev
A common situation for database-backed applications is the need to change the attributes of a column. One can change the data type, or...
Read more >
How to troubleshoot and fix PostgreSQL performance issues
To see the differences in performance, look at execution time. If you're using psql, turn on the execution time with \timing . The...
Read more >
What problems are there in not using a primary key column at ...
The problem with a table without a primary key, is that it can potentially have duplicate rows, and, in the relational model, duplicate...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found