Drf entries

Yazılımcı ve Veri Bilimci arkadaşların görüşlerini almak istiyorum (giriş seviyesi iş bulamamak)

2023.05.23 11:28 Shacatpeare Yazılımcı ve Veri Bilimci arkadaşların görüşlerini almak istiyorum (giriş seviyesi iş bulamamak)

Merhaba, öncelikle kendimden kısaca bahsetmek istiyorum. İngiliz Dili ve Edebiyatı mezunuyum. Yaklaşık 1.5 yıllık sürede de yazılımla ilgilenmekteyim. Tecrübemin büyük bir kısmını Python ve Django oluşturuyor. Tabii bu hayal için (full stack django developer) yanında öğrendiğim diğer şeyler ( SQL, JavaScript & TypeScript, Html, CSS, Git & Github, Bootstrap 5, Tailwindcss, Nginx, Gunicorn, ubuntu server, basic networking) de oldu. Özellikle raw SQL bilgime Django ORM 'yi anlamak için ağırlık vermiştim. Elimde üç adet hayata geçmiş projem de var (ikisi django ile alakalı olmakla birlikte), bu projelerden ikisi ingilizce eğitimi üzerine kurulu; bu süreçte öğrenci bularak finansal yan gelir elde etme amaçlıydı.
Türkiye içerisinde yaşadığım giriş seviyesi iş bulamama sorunu
Özellikle türkiye içerisinde Django üzerinden konuşacak olursam giriş seviye ilan bulamıyorum, en çok karşıma çıkan 3 yıl tecrübe + ilgili bölümlerden mezun (bilişim, matematik etc.) ki ben İDE mezunuyum... Yurt dışı ilanlarına baktığımda bu seçenekler daha geniş entry-level ilanları karşıma çıkıyor, ve almanyada bazı firmaların yetiştirmek üzere alımlar yaptığına da denk gelmiştim. Tabii bu yurt dışı olanakları orada yaşayanlar için, herhangi bir vize sağlamayacaklarını kendileri de ifade ediyorlar.
Veri Bilimci olarak Türkiyede iş bulmak daha basit olur mu, ne tarz bir proje çıkarabilirim?
Veri bilimi üzerinde de benzer sınırlamalar var "ilgili bölümden mezun" ama bu konuda daha fazla iş ilanına denk geldim, bir proje üzerinden kendimi gösterebilirsem şansımın artacağını düşünüyorum tabii yine bilemiyorum çünkü bir süredir iş aramaya çalışıp da bulamamanın üstümde bıraktığı bir moralsizlik var. Veri üzerine yaptığım çoğu şey yine django orm ile yaptığım demolar oldu, şu anda da drf üzerinde çalışıyorum projelerimden birisini yenilemek için. Aklıma leetcode üzerinden soru çözmekten başka bir şey gelmiyor bu konuda. En fazla veri oluştururum, sıralarım, diagramını yaparım gibi.
Sonuç olarak
Nasıl bir yol izlemem gerektiğini bilmiyorum, moralimi yüksek tutmakta zorlanıyorum. Artık işe girmem gerekiyor çünkü junior seviyesinden yükselebilmek için iş ortamı tecrübesine ve takım çalışmasına ihtiyacım var. Tavsiyelerinizi bekliyorum.
submitted by Shacatpeare to Turkey [link] [comments]


2023.05.22 11:45 wolfson109 DRF views across multiple tables

I've written an API using DRF to help with tracking multiple deployments of an app with different configurations, so I have about half-a-dozen models with many-to-many relationships between each. Here's an example of one of my models:
class Package(models.Model): engine = models.ForeignKey(Engine, on_delete=models.CASCADE) ruleset = models.ForeignKey(Ruleset, on_delete=models.CASCADE) configuration = models.ForeignKey(Configuration, on_delete=models.CASCADE) created = models.DateTimeField(auto_now_add=True) 
Each of the Engine, Ruleset and Configuration models has a name field. I was able to get the API running very quickly, the problem is that DRF expects that if I create a new package entry that I should supply the ID numbers for each of engine, ruleset and configuration. Is there a way I can allow the user / client to supply the name for each instead?
Similarly, when accessing in the browser, the view for Package just shows the ids of the other pieces and the form wants me to pick from a list of ids instead of names. Do I need to write a custom view and form myself to be able to see their names, or is there some configuration or plugin option that will handle this for me?
submitted by wolfson109 to django [link] [comments]


2023.05.20 05:36 EmperorPaulchen It is the end of 1902. Somehow, the Dutch have maintained their independence

submitted by EmperorPaulchen to diplomacy [link] [comments]


2023.04.01 17:21 emmyarty DxSvelte - Build a Svelte-powered SPA using Django views & routing. Not quite templating, not quite DRF.


Build your SPA in Django, with ease.

Django x Svelte: Alpha

Brief blurb on some project background before we get to the README itself, this project is my intended entry for the Svelte Hackathon, and the TL;DR is "what if instead of picking between Django templating and SPA+DRF only to sacrifice something either way, we did... both?"
Build out your SPA as easily as you'd write out templates, and take advantage of Django's 'batteries included' philosophy while you do so. DxSvelte parses its way through your Django project and automatically rolls up an SPA which mirrors the structure of your Django project.
You get full SSR and lightweight page loads. Navigating away from the site or to a page which isn't within the SPA's scope? No problem, it'll just follow the link. Speaking of links, just use your ordinary tags.
In the near future I'll be publishing a demo project which demonstrates how it works in practice, but in the meantime if anyone gives this a go and finds any of the steps are too ambiguous or missing key details, kindly let me know and I'll do my best to sort it out!
It's still early days and nowhere near ready for a formal release, but there's enough of it operational to play around with and produce something that is functional and pleasing to use. Which is further than where I was aiming to be at this point, so I'm pretty content. Naturally, you will need NodeJS installed during development - I'm aiming to do away with that requirement for deployment down the road.
Contributions to the project are most welcome.
Without further ado...
GitHub NPM
Warning: This project is in early Alpha and key features are still under active development. Please note that, for the time being, you will need to delete the automatically generated tsconfig.json and dxsvelte.py files from your project's root directory. The current behaviour is to not overwrite these files.
DxSvelte is a powerful integration package that enables you to use Svelte as a front-end framework for Django web applications. With DxSvelte, you can easily build single-page applications (SPAs) that leverage the full power of both Django and Svelte, without having to worry about REST endpoints using DRF.

Milestone Release 0.0.18

Features

To-Do List & Known Bugs

  • CSRF: For the time being, you'll need to use the exemption decorator. This will be addressed in a future preview release.
  • Node Dependency: Down the road, the aim is to revert back to the embedded V8 runtime. For now, the target platform will need to have NodeJS installed, as well as Python.
  • VENV Usage: Configuration options for virtual environments aren't currently supported. Please ensure that 'python' is bound to a version which works with your version of Django so the router resolution during build can take place. This only affects the build step and will not affect how you run your server.
  • Page Title Updates: Will be added in the near future.
  • CSS Generation: PostCSS support for Tailwind etc.
  • Type Generation (Autocomplete): Decision TBC

Getting Started

To get started with DxSvelte, initialise your Django project so it's ready to start building your SPA:
npx dxsvelte npm i 
You should now have a directory tree resembling the following:
my_project_name ├── manage.py ├── dxsvelte.py ├── package.json ├── tsconfig.json ├── my_project_name │ └── ... ├── static │ ├── index.html │ ├── ... └── ... 
At this point, you can start building out your individual Django apps. To 'tag' them so that they are rolled up into the SPA, you need to assign names to your paths and prefix them with '$', like so:
# Example app called 'home_page' from django.urls import path from . import views urlpatterns = [ path('', views.index, name='$index'), path('about', views.about, name='$about'), ] 
Then, within the corresponding views:
from dxsvelte import render def index(req): # Your normal view logic goes here return render(req, data?) def about(req): return render(req) 
Build out your view components, and optionally within your main app folder create your own layout.svelte file:
my_project_name ├── manage.py ├── dxsvelte.py ├── package.json ├── tsconfig.json ├── home_page │ ├── ... │ └── views │ ├── index.svelte │ └── about.svelte ├── my_project_name │ └── layout.svelte └── ... 
If you do write your own layout.svelte component (recommended), ensure that you leave the '' element in there somewhere - that's what gets replaced with your page contents. For now, more advanced layouts are not supported.

Your Website Name.

Finally, build it.
npm run compile 
That's it! Now you can start building your Svelte-powered hybrid SSR SPA, all while using Django as your back-end.

Passing Parameters & Server-Side Props

You can now pass your server-side props as a Dict from your Django view directly to Svelte, while still taking full advantage of SSR. Usage is simple, but be sure to validate your objects on the front-end before accessing them. The data argument is optional and can be omitted if you have no server-side properties to pass.
urlpatterns = [ path('', views.index, name='$index'), path('about//', views.about, name='$about'), ] @csrf_exempt def about(req, company): data = { "aboutUsText": "Lorem ipsum dolor sit amet, consectetur adip...", "company": "You are viewing the page for " + company + "!" } return render(req, data) 
Meanwhile, in your about.svelte component over in the ./views directory:
 {#if data?.company && data.aboutUsText} 

About {data.company}.

{data.aboutUsText} {/if}
That's it! For now...
submitted by emmyarty to django [link] [comments]


2023.04.01 07:42 emmyarty Django x Svelte (DxSvelte) - bringing Svelte to your Django projects!

Django x Svelte (DxSvelte) - bringing Svelte to your Django projects!

https://preview.redd.it/9lzkxtr9n7ra1.png?width=150&format=png&auto=webp&s=1db0bf4ee4ab7a16ca54d92477176b101ff7c8fc

Django x Svelte: Alpha

Brief blurb on some project background before we get to the README itself, this project is my intended entry for the Svelte Hackathon, and the TL;DR is "what if instead of picking between Django templating and SPA+DRF only to sacrifice something either way, we did... both?"
Build out your SPA as easily as you'd write out templates, and take advantage of Django's 'batteries included' philosophy while you do so.
It's still nowhere near ready for a real release, but there's enough of it operational to play around with and produce something that actually works. Which is further than where I was aiming to be at this point, so I'm happy.
GitHub NPM
Warning: This project is in early Alpha and key features are still under active development. Please note that, for the time being, you will need to delete the automatically generated tsconfig.json and dxsvelte.py files from your project's root directory. The current behaviour is to not overwrite these files.
DxSvelte is a powerful integration package that enables you to use Svelte as a front-end framework for Django web applications. With DxSvelte, you can easily build single-page applications (SPAs) that leverage the full power of both Django and Svelte, without having to worry about REST endpoints using DRF.

Milestone Release 0.0.18

  • Route Parameters: You can now use your values in DxSvelte routes - they work. Use them to customise your server-side props, and build out your individual views as before.
  • CSS Generation: CSS now builds successfully where included in the style tags, but be warned that PostCSS will still not work. For now the mixture of component styling & pre-built stylesheets has pushed the outstanding down the priority queue for now, but it is still on the list.
  • Django Dict -> Svelte Data Passing: SSR improved and cleaned up, more refactoring.

Features

  • Seamless Integration: DxSvelte integrates tightly with Django's route resolvers, allowing you to easily build SPAs with Svelte without manually connecting the dots through DRF (though you don't lose that functionality, should you need it). The whole philosophy here is that SPA functionality can and should be a 'first class citizen' in Django.
  • Automatic SPA Generation: You don't have to manually configure REST endpoints or manage complex API interactions. Instead, DxSvelte automatically generates the SPA for you, based on the routes defined in your Django app.
  • Efficient Rendering: DxSvelte uses Svelte's efficient rendering engine to deliver fast and responsive user experiences, without sacrificing the power and flexibility of Django. But not only that, DxSvelte also takes care of SSR (Server Side Rendering), so that the first page-load is already rendered when it arrives in the browser.
  • Fast Compilation: DxSvelte uses ESBuild (a powerful JS compiler written in Rust) under the hood to give you the best possible compile times.
  • Incremental Adoption: The default behaviour when it comes to navigation makes it easy to adopt the SPA incrementally. If you have an existing project you don't want to rewrite or only want for a specific portion of the site to be an SPA, then just keep going as you are; the SPA will honour any tags which lead away from the SPA by checking itself against the automatically generated routing table.

To-Do List & Known Bugs

  • CSRF: For the time being, you'll need to use the exemption decorator. This will be addressed in a future preview release.
  • Node Dependency: Down the road, the aim is to revert back to the embedded V8 runtime. For now, the target platform will need to have NodeJS installed, as well as Python.
  • VENV Usage: Configuration options for virtual environments aren't currently supported. Please ensure that 'python' is bound to a version which works with your version of Django so the router resolution during build can take place. This only affects the build step and will not affect how you run your server.
  • Page Title Updates: Will be added in the near future.
  • CSS Generation: PostCSS support for Tailwind etc.
  • Type Generation (Autocomplete): Decision TBC

Getting Started

To get started with DxSvelte, initialise your Django project so it's ready to start building your SPA:
npx dxsvelte npm i 
You should now have a directory tree resembling the following:
my_project_name ├── manage.py ├── dxsvelte.py ├── package.json ├── tsconfig.json ├── my_project_name │ └── ... ├── static │ ├── index.html │ ├── ... └── ... 
At this point, you can start building out your individual Django apps. To 'tag' them so that they are rolled up into the SPA, you need to assign names to your paths and prefix them with '$', like so:
# Example app called 'home_page' from django.urls import path from . import views urlpatterns = [ path('', views.index, name='$index'), path('about', views.about, name='$about'), ] 
Then, within the corresponding views:
from dxsvelte import render def index(req): # Your normal view logic goes here return render(req, data?) def about(req): return render(req) 
Build out your view components, and optionally within your main app folder create your own layout.svelte file:
my_project_name ├── manage.py ├── dxsvelte.py ├── package.json ├── tsconfig.json ├── home_page │ ├── ... │ └── views │ ├── index.svelte │ └── about.svelte ├── my_project_name │ └── layout.svelte └── ... 
If you do write your own layout.svelte component (recommended), ensure that you leave the '' element in there somewhere - that's what gets replaced with your page contents. For now, more advanced layouts are not supported.

Your Website Name.

Finally, build it.
npm run compile 
That's it! Now you can start building your Svelte-powered hybrid SSR SPA, all while using Django as your back-end.

Passing Parameters & Server-Side Props

You can now pass your server-side props as a Dict from your Django view directly to Svelte, while still taking full advantage of SSR. Usage is simple, but be sure to validate your objects on the front-end before accessing them. The data argument is optional and can be omitted if you have no server-side properties to pass.
urlpatterns = [ path('', views.index, name='$index'), path('about//', views.about, name='$about'), ] @csrf_exempt def about(req, company): data = { "aboutUsText": "Lorem ipsum dolor sit amet, consectetur adip...", "company": "You are viewing the page for " + company + "!" } return render(req, data) 
Meanwhile, in your about.svelte component over in the ./views directory:
 {#if data?.company && data.aboutUsText} 

About {data.company}.

{data.aboutUsText} {/if}
That's it! For now...
submitted by emmyarty to webdev [link] [comments]


2023.02.21 12:29 Fatalstryke Spoilers inside - Want help planning my next Subnautica run

I've already beaten the game before and gotten all the Steam Achievements. Now I'm looking for help planning the first part of a glitchless 100% Survival run. Most of the stuff I can just get at any time, so I'm not worried about that since this isn't really a "speedrun". What I do want is no deaths (I'll reload a save if I have to, I'm not doing hardcore or anything), no cheats, no glitches like super Seaglide or whatever, with 100% Databank entries, 100% of the feasible voice logs, and specifically I do want to disable the gun before the Sunbeam arrives to get THAT voice log.
Now, I see that I'll have to do a total of 5 self-scans, I'll have to visit the Disease Research Facility before getting the cure, I'll need to attempt to disable the Quarantine Enforcement Platform while infected, and I think the only other real concern is making sure I scan one of the breaches before repairing them in the Aurora.
That all being said, can't I put the Aurora off until after the cure? Are there any other rare or obscure Blueprints or Databank Entries or Voice Logs I can do that aren't normally part of the 100% speedrun checklist? Is there anything else I should be considering about the order in which I do my scans/QEP/DRF/self-scans/cure?
submitted by Fatalstryke to subnautica [link] [comments]


2023.02.04 03:04 BlackEagle876 70% used for a 150miles driven MYLR, normal?

70% used for a 150miles driven MYLR, normal?
Hello, Does that look normal for everyone else? 2022 MYLR with mix driving in a good weather temps between 40F-60F.
Thanks in advance!
submitted by BlackEagle876 to TeslaLounge [link] [comments]


2022.12.21 16:25 AudiophileHeaven Khadas Tone2 PRO, mini DAC/AMP with Balanced RCA, sleek design, Balanced 4.4mm headphone output & high power - a video review

Khadas Tone2 PRO, mini DAC/AMP with Balanced RCA, sleek design, Balanced 4.4mm headphone output & high power - a video review
Howdy, Reddit,
My video review exploring the Khadas Tone 2 PRO DAC / Balanced RCA / Balanced Headphone Amplifier is live now~ If you're looking for an entry-level / midrange DAC/AMP with many features, a volume wheel, balanced headphone output, Balanced RCA outputs, and an edgy design, my video explors the Tone2 PRO, and should come in handy
https://www.youtube.com/watch?v=DRfTY51V2Fs
https://preview.redd.it/epz7p29er97a1.jpg?width=1200&format=pjpg&auto=webp&s=3ee2f23a1fd6438cb989556f55655f6db902a0e2
submitted by AudiophileHeaven to headphones [link] [comments]


2022.08.27 15:23 Fearless_Ant4603 How do I check my ICAP results?

What are the responsibilities of sales support?
Sales Support Job Duties:nn Generates and processes new sales leads as necessary. Answers phone calls from customers and deals with problems as they arise. Takes sales information and puts it into an easily readable format. Follows up with customers to make sure that they are satisfied with a particular product. via
How can I do pharmaceutical sales?
If you're interested in becoming a pharmaceutical sales rep, here are the steps that are specific to this role.Earn a bachelor's degree. ... Enroll in a training program. ... Get licensed or certified. ... 7 Reasons Sales is Still a Great Career (x26amp; 7 Reasons Why Not) via
Which Russian banks were removed from Swift?
In March, seven Russian banks were removed from Swift including Bank Otkritie, Novikombank, Promsvyazbank, Bank Rossiya, Sovcombank, Vnesheconombank (VEB) and VTB Bank. via
Why is called fixed income?
'Fixed income' is a broad asset class that includes government bonds, municipal bonds, corporate bonds, and asset-backed securities such as mortgage-backed bonds. They're called 'fixed income' because these assets provide a return in the form of fixed periodic payments. via
What watch is used by special forces?
GPS Watches: These watches were designed to provide GPS related information while telling the time as a secondary feature. GPS Watches are often not allowed inside classified buildings but are often used by Special Forces out in the field. via
How much do train drivers in Canada make?
The average train driver salary in Canada is $45,825 per year or $23.50 per hour. Entry-level positions start at $39,000 per year, while most experienced workers make up to $97,500 per year. via
How many hours do train drivers work UK?
Train drivers work 35 hours per week, spread over 4 to 5 shifts (also known as turns). These may include weekends, evenings, nights and Bank Holidays. Freight engine drivers tend to work more night shifts and do long-distance routes, which often entails overnight stays away from home. via
What is typical occupancy rate?
For many hotels, an ideal occupancy rate is between 70% and 95% - though the sweet spot depends on the number of rooms, location, type of hotel, target guests, and more. via
Where are most vertical farms located?
Currently, the country with the highest number of vertical farms is the USA. In Asia, the leading countries in the industry are Japan, China, Singapore, South Korea, Taiwan, and Thailand. In Europe, vertical farms can be found among others in Germany, France, UK, and the Netherlands. via
How many marks are required in entry test for admission in PIEAS?
A minimum score of 2000 is required. The PIEAS institutional code to receive SAT scores is 7272. via
Can I watch the All-Star Game on the Internet?
You can watch the MLB All-Star Game live for FREE with DirecTV Stream (free trial), or with fuboTV (free trial). You can also follow along with the latest live updates and see more live streaming and TV options for this game provided below. via
Which is better auditor or accountant?
Accountants are responsible for preparing financial documents, monitoring day-to-day bookkeeping for a firm's operations, and/or preparing and filing tax forms. Auditors verify the accuracy of financial statements and tax filings and may search for clues as to why some figures don't quite add up. via
Is Paramount Fine Foods a franchise?
If you have a desire for owning your own business that matches your passion for fresh, flavourful and authentic foods, one of our restaurant franchises may be the perfect fit for you. via
Who owns Paramount food?
Mohamad Fakih CM is a Lebanese-Canadian businessperson, and philanthropist. Founder of the Middle Eastern Halal restaurant chain, Paramount Fine Foods, Fakih is also known for his charitable work, philanthropy, and community service through the Fakih Foundation. via
How can I download full movies?
Top 10 Free Movie Download Sites to Download Full HD Movies 2021Archive.Org.Movie Flixter.O2tvseries.YTS.Youtube.AZmovies.1337X movies.Toxicwap. via
How many assisted living facilities are in NYC?
Directory of Assisted Living Facilities in New Yorknn See our directory of 523 assisted living facilities in the state of New York to start that process. via
Which is bigger Kansas City MO or Kansas City KS?
There's the major metropolis of Kansas City, Missouri (population: 490,000), as well as Kansas City, Kansas (population: 152,000), which is actually and confusingly considered part of the larger Kansas City, Missouri metropolitan area. via
Can anyone use Toronto Public Library?
Any person who lives, works, attends school or owns property in the City of Toronto, or who has an immediate family member living at the same address who owns property in the City of Toronto, or any person who lives on a First Nations reserve in Ontario, is eligible for membership with borrowing privileges without ... via
What goes with 33 in play whe?
The NLCB Play Whe ChartsNumbersMarks32Shrimp33Spider34Blind Man35Big Snake via
Why do girls like SVU?
By creating an idealized reality interspersed with reminders of real injustice, SVU is just relatable enough for the stories to hit home, but enjoyable enough to become a much-needed escape.Nov 4, 2014 via
What does a liaison officer do FEMA?
The Liaison Officer is a conduit of information and assistance between incident personnel and organizations that are assisting or cooperating with the response. 1. This position can be ordered as a single resource or in conjunction with a National Incident Management System (NIMS) typed team (Incident Management Team). via
Which power plant has no emission?
Zero Emission Power Plants (ZEPP)nn Clean Energy Systems has developed an oxy-fuel combustion technology that uses pure oxygen to combust natural gas or other fuels in a manner that produces clean power, commercial CO2, and clean water -- with zero emissions released to the atmosphere. via
Why did they use a tee?
The tee itself enables the golf ball to stay above ground for the initial shot of each hole. Golfers aren't required to use a tee, but it is a commonly used item. Having the ball above ground offers less resistance than taking a shot on the turf.Sept 19, 2017 via
Is pharmaceutical sales a good industry?
It is a known fact that pharmaceutical sales representative earn a very good living, between the base salary, variable compensation and premiums, without counting the reimbursement of expenses. via
Did they change the cast in Outlander?
Three new actors will join the Outlander cohort - and fans may recognise them from other programmes. The fresh names joining the popular show's credits are Mark Lewis Jones, Alexander Vlahos and Jessica Reynolds. via
What part of the US has mild weather year round?
  1. Californiann You can't beat the south and central California coast for pleasant temperatures year round. Long Beach, Los Angeles, San Diego, Santa Barbara and Santa Maria all have average daily highs no lower than the mid-60s for any month of the year. Nor does it get really hot. via
Did SpaceX SN15 explode?
Starship SN15 survives launch and landingnn On May 5, 2021, SpaceX made a Starship triumph when its Starship SN15 prototype launched and landed safely (opens in new tab), and didn't explode afterwards. via
Is EDP Renewables a public company?
EDP Renováveis is the fourth-largest generator of wind energy globally.n...nEDP Renováveis.TypePublic (Sociedade Anónima)Traded asEuronext Lisbon: EDPRIndustryRenewable energyFounded2007 (as separate company)HeadquartersMadrid, Spain via
How do I check my ICAP results?
Students can also receive their results on their mobile phones. They need to open the 'Write Message' option of their mobile phone and type. ICAP Roll No + Date-of-Birth (dd-mm-yy) and send it to 8282. via
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31-ssh/) 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300
submitted by Fearless_Ant4603 to MilanNews [link] [comments]


2022.04.28 21:42 Nickt1596 Where to place Business Logic using the Rest Framework?

At work I use MVC with Vue JS and .NET Framework, so I am pretty familiar with API's but am a bit stumped on how to handle the controller aspect of things when it comes to the Django Rest Framework.
For my personal project I am using Vue as the front end and want to use Django as the backend, with the rest framework powering the API calls. To give an example of what i'm stuck on...
Lets say I have the following Models for a sports league website. Team , TeamStats (Holds the stats for a given Team) , Player , PlayerStats (Holds the stats for a given Player)
When adding a new team, I also want to create an entry into TeamStats if one doesn't exist.
When entering the results of a game and I enter a goal for Player X, I will need to update the PlayerStats model as well as the corresponding team models.
Where is the best place to handle such things while also following the standard DRF guidelines?
submitted by Nickt1596 to djangolearning [link] [comments]


2022.02.28 20:34 SnooPredictions8336 When using post method to create custom user no updated data appears in database

Hello everyone,
I would love to get your help these two problems that I have:
  1. I am trying to use DRF to build my final college project,I have created custom user and based on that model I have created two user types (researcher and participant).
I am currently trying to test Researcher post request with no success, everything seems to work fine but I don't see the new researcher entry in my admin site or GET list of all researchers request.
2) Another thing is, i'm not quite sure it is right to have the 'permission_classes' nor the 'authentication_classes' to an APIView class that is suppose to be accessible for all users.
Here is the repository for the project - Mercury_project
Thank you very much!
submitted by SnooPredictions8336 to django [link] [comments]


2022.02.03 06:29 adrenaline681 Best architecture to upload user submitted videos to Youtube using Django Rest Framework?

I want my users to be able to submit videos to our Youtube channel and they will be displayed on the website only once they are approved by us. I use React as my frontend and DRF as my backend.
I'm having trouble trying to figure out the architecture of the system. So far I have come up with 2 options.
A) Logged in user uploads video to the S3 bucket and create an entry in the DB. The entry would look something like this
created = datetime user = ForeignKey(User) approved = False uploaded = False file = Path to S3 location (/videos/this_is_my_cool_video.mp4) youtube_id = None 
Then we will search for all non-approved videos and view them. Then I could click "approve" and the backend will upload the file to Youtube and will change the values of the entry
approved = True uploaded = True youtube_id = dQw4w9WgXcQ 

B) The second option I thought is that the user send the video to the backend which will automatically upload it to Youtube. then we will review it and switch the approved field to True.

My questions are:
  1. Which of these 2 method do you think I should follow and what's your reasoning? If neither, what other alternative would you suggest?
  2. How should I go about uploading the video to Youtube, should I just use the regular Django server or should I use a Celery Task for this?
  3. Any other suggestions you have?

Many thanks for your time!
submitted by adrenaline681 to django [link] [comments]


2021.12.23 00:49 kbk2015 DRF and ManyToMany Relationships

Hello! I'm back as a follow up to my previous post, I'm looking for some more help surrounding many to many relationships but this time sprinkling in Django REST Framework.
I have a couple of questions regarding this -
As a recap from my previous post, I have 3 tables Load, Container, and ContainerLoad (this is a custom intermediary table that I created). A container can have many loads on it, just as a load can belong to many containers.
I was able to figure out how to automatically create an entry in the ContainerLoad intermediary table when an entry in Load is created using DRF and django's ManyToManyField.
Second Question (and the more important one tbh)
Since for my project an instance of a container can have multiple loads on it, I need to be able to track these multiple loads belonging to a container and I'm assuming I'd do this in the ContainerLoad intermediary table. I can easily add a column to this table called "second_load", "third_load", or something along those lines with another FK relationship back the Load table.
However, let's say that I create an initial Load entry and it creates a ContainerLoad record of id =1 load_id = 1 container_id = 1 second_load_id = null and then at a later date I realize I need to create a new load to add to this existing ContainerLoad entry. I do not want to create a new record in ContainerLoad with id = 2, i want to append the new load id I just created to the existing id = 1 ContainerLoad record, specifically in the second_load_id column
How would I go about doing that? Would I have to create a PATCH endpoint for "ContainerLoad" ? I'm getting stuck on thinking through the logic of this.
----------------------------------------------------------------------------------------------------------------------------------------------
models.py file (shortened for brevity)
class Load(models.Model): id = models.AutoField(primary_key=True) container_number = models.ManyToManyField(Container, through='ContainerLoad',through_fields=('load','container'),related_name='loads') ... class Container(models.Model): id = models.AutoField(primary_key=True) container_number = models.CharField(max_length=15) class Meta: db_table = "Container" class ContainerLoad(models.Model): load = models.ForeignKey(Load, on_delete=CASCADE) second_load = models.ForeignKey(Load,on_delete=CASCADE,related_name='second_load',null=True,blank=True) container = models.ForeignKey(Container, on_delete=CASCADE) class Meta: db_table = 'ContainerLoad' 
serializer.py file (shortened for brevity) - Please keep in mind I'm using a package for writeable nested serializers
class LoadSerializer(WritableNestedModelSerializer): ... container_number = ContainerSerializer(read_only=False,many=True) ... class Meta: model = Load fields = '__all__' depth = 1 class ContainerSerializer(serializers.ModelSerializer): container_number = serializers.CharField() class Meta: model = Container fields = '__all__' depth = 1 class ContainerLoadSerializer(WritableNestedModelSerializer): class Meta: model = ContainerLoad fields = '__all__' depth = 1 
view.py file (shortened for brevity - specifically just showing the "Load" get & post requests)
class LoadViews(APIView): def post(self, request): serializer = LoadSerializer(data=request.data) if serializer.is_valid(): serializer.save() return Response({"status": "success", "data": serializer.data}, status=status.HTTP_200_OK) else: return Response({"status": "Error", "data": serializer.errors}, status=status.HTTP_400_BAD_REQUEST) def get(self, request, id=None): if id: load = Load.objects.get(id=id) serializer = LoadSerializer(load) return Response({"status": "success", "data": serializer.data}, status=status.HTTP_200_OK) else: start = request.GET.get('start', '0') finish = request.GET.get('finish', '10') loads = Load.objects.all()[int(start):int(finish)] serializer = LoadSerializer(loads, many=True) return Response({"status": "success", "data": serializer.data}, status=status.HTTP_200_OK) 
submitted by kbk2015 to django [link] [comments]


2021.11.15 00:42 Just66in [Artisan] Sir Ferret Glutton Kleptoparasitism KeyCap Raffle Sale by Jusherhoe

https://imgur.com/gallery/Hs4Ks6v
Hello everyone!
Meet: Sir Ferret Glutton
He's a glutton for food and also a food thief so you have to be wary when eating or having food around your keyboard! And yes, that is a doughnut that he's already having there, but still so greedy...
https://forms.gle/9kEx1NE94LbDrfWW9
Shipping costs:
Follow me on my personal Instagram profile for future sales/updates:
https://www.instagram.com/jusherhoe/
As always, thank you all for making this possible for me <3
submitted by Just66in to mechmarket [link] [comments]


2021.08.29 00:51 iammare2 Looking for best calendar for Australian Horse Racing Events...

Hi, I am having trouble cross referencing drf entries with local simulcast calendars and the actual Australian events. Anyone have a good calendar?
submitted by iammare2 to horseracing [link] [comments]


2021.08.29 00:48 iammare2 Looking for best calendar of Australian horse racing events

I am having difficulties cross referencing the simulcast calendars for local casinos with drf entries info and the actual Australian races. Does anyone have a good calendar or method of reference? Thanks in advance!
submitted by iammare2 to australianhorseracing [link] [comments]


2021.08.22 12:37 BragdyMan Handling web-based real-time updates

Hello, Hope you are having a great day,
I was wondering how would you handle real time updates in DRF , I've been going through projects in Github and what I found the most was joining a channel just like how you would handle messages and whenever there is an update it will send to the concerned clients.
However, I find that quite expensive specially when you have multiple types of updates (for eg: notifications,messages,keeping track of online people,keeping track of new data entries) so I came here looking for kind of a clarification if I'm wrong and suggestions if there is anything better or how you personally handle these type of stuff.
Thank you.
submitted by BragdyMan to django [link] [comments]


2021.08.02 14:42 TheJavoClown Tipping Competition

Hi to all,
I was thinking of running a tipping competition, but quite different than usual. I’ve seen a lot of competitions where you can win even if you’re not profitable, so I would like to make a fairer competition. This is only the sketch, so feel free to comment no only if you would be interested in participate but also if you think your idea could improve the competition.

Rules:

Entry cost: FREE.
Duration: To be decided.
Race to predict: DRF today’s free PP (not sponsored, but this way all people can play without spend a penny).
Point system: for the selected race you should pick any number of selections and provide the probability of each to win (from 0, impossible to win, to 1, 100% winning probs). Once the result chart is published in DRF’s web, a $100 is simulated for each selection if 1 divided by the odds ($1 Mutuel odds plus one) is lower than the probabilities you selected for that horse. If the horse wins you earn points equal to the simulated bet profit and if the horse loses you also lose 100 points. Let’s see it with an example, the Clement Hirsch Stakes. You pick two selections, Shedaresthedevil (0.5) and Paige Anne (0.02). The result chart is released, and the Mutuel Odds are 2.3 (1.3 + 1) for Shedaresthedevil and 28.2 (27.2 + 1) for Paige Anne. Then the allowed bets are calculated: 1/2.3 = 0.43 (so this bet is simulated, as you pick 0.5, which is higher than 0.43) and 1/28.2 = 0.04 (so this bet is skipped, as you selected 0.02). To finish, the scored points are calculated: 100*1.3 = 130 points earned. Of course, if you don’t calculate probabilities, you can still participate, simply pick your favorite, and assign it a 1 (100% winning chance), so the bet is always simulated.
Would you be interested in participating in a tipping competition like this?
Again, these are only my first thoughts, so feel free to share your opinions, improvements or to comment if you would participate.
Thank you all!
submitted by TheJavoClown to horseracing [link] [comments]


2021.06.04 12:17 philgyford How can I filter a DRF ListAPIView by two URL kwargs (and is it a good idea)?

I'm making a read-only API for an existing Django project using DRF, which I haven't used much before.
One of the models is for a diary Entry. There can be one Entry per day. I'd like provide the ability to list all Entries, all Entries for a year, all Entries for a year+month, or get a single Entry.
I'm thinking of having URLs something like this:
I have two questions:
  1. Does that URL schema make sense for an API? It feels slightly unusual to have something like /api/entries/// for getting a list, and requiring three arguments to get a single item, but it also makes some sense.
  2. DRF views have a single lookup_field and lookup_url_kwarg. How would I make a ListAPIView optionally accept both year and month for filtering the results? Similarly, how can I make a RetrieveAPIView require and use three fields/kwargs?
submitted by philgyford to django [link] [comments]


2021.04.07 01:14 yrocaz DateTimeField & blanks - How can I override / create a custom DateTimeField?

Hi All,
I've got an enormous dataset and I'm trying to use Django as a front end with DRF to allow me to parse the data for a few apps I'm developing. At least that's the idea, but I can't get the data into the ORM.
Specifically, I'm running into some serious issues with dates. Here's an example of the model:
class MyModel(models.Model): my_dt_field = models.DateTimeField(null=True, blank=True) 
Everywhere you look on Stackoverflow you'd think having null=True, blank=True would allow you to have blank dates, but that is simply not the case. I've tried everything from deleting migrations, dropping the table and recreating from scratch with the above parameters to trying NaN and None values. No dice.
I thought I was going crazy but I finally got to the source code and it says it there plain as day in the first line:
class DateTimeField(DateField): empty_strings_allowed = False ... 
This poses a problem for me because the data needs blank fields. For example, a future event that has not happened should not have an datetime entry, and if only one of x-outcomes is possible then I don't want the x-1 outcomes that didn't come to pass having a date in there either. Long story short, blanks are a useful filter.
So! Any ideas? While writing this I got the bright idea to create my own custom class BlankDateTimeField by copy pasting the entire DateTimeField class empty_strings_allowed = True and using that in my models but that doesn't seem to have worked.

edit:
The error is:
django.core.exceptions.ValidationError: ["'' value has an invalid format. It must be in YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ] format."]
This is the code kicking off the error:
raise exceptions.ValidationError( self.error_messages["invalid"], code="invalid", params={"value": value}, ) 
Any ideas how to prevent "" from failing validation/firing this off?
submitted by yrocaz to djangolearning [link] [comments]


2021.03.26 07:44 iEmerald Immigrating to Canada as a Developer possible?

Hello :)
I am 24, married, both me and my wife have our BSc in Computer Science, and I am from Iraq.
I am a full stack developer I mainly work with Django / PHP because they are the most popular technologies where I live, but I can also work with Angular on the FE, and DRF on the BE. I also have the Google IT Certificate (if that's of any help).
Is it possible for me to immigrate to Canada? I am also aware of the ExpressEntry program, but I just want to get more tips from you guys, what do I need to know before applying to get my chances even higher?
submitted by iEmerald to ImmigrationCanada [link] [comments]


2021.03.23 09:26 vazark Can a ModelSerializer validation run within a generic Serializer

I have a set of DRF serializers that look like something like,
```python
class ProductSerializer(serializers.ModelSerializer): class Meta: model = Product fields = ('id','value')
class RequestSerializer(serializers.Serializer): product = ProductSerializers(many=True)
```
Is there any standard way that I can use to validate if the RequestSerializer checks if the id entry exists in the DB when making a POST request?
submitted by vazark to django [link] [comments]