Django Celery Beats Package Add Custom Model Fields - celery

I am working with the pypi django_celery_beats package in a project (https://pypi.org/project/django-celery-beat/) and I am in a situation where it would be beneficial to add fields to the PeriodicTask model, but I am struggling to think of how to extend the model where it will still work as expected since the package will not know to use my newly created CustomPeriodicTask(PeriodicTask) model.
So my question is, do I need to store the package locally and edit the source or can I override the fields in the model without having to go through all of that trouble?

If the behavior of the core functionality will change based on your field changes, then you'll have to fork the repo and make your own updates.

Otherwise you could create a model layer alongside the PeriodicTask with a OneToOne Relation between them.

Related

Edit related child models in Laravel Backpack

I've just recently started using Backpack and quite like it so far.
I'm trying to figure out the best way to allow create/update for related models in Laravel Backpack.
When there is a One-to-Many or even Many-to-Many relationship, we can use field type relationship and it works. We can create new child model using the inline feature.
However, the added child model is shown as a small tag with a cross icon only. We cannot see the details of this model and cannot edit it from that screen. It would be great if we could show the existing child models as a table with edit link that opens a modal. Is there any existing component that kind of does that?
If not, how can I go about achieving this?
Alternate approach: can I use the table field and somehow modify it so that data is saved as child models instead of json? I am happy to take either approach, whichever is better.
I hope I was able to articulate what I'm trying to achieve, I'm happy to use any other approach that is there or easier.
Thanks in advance.

Does EF Core 3.1 support use of SQL Views inside of code-first DbContext?

I currently have an ASP.NET Core project using EF 3.1. I would like to use Code-First to manually build most of my entities, but there is also a linked server I need to incorporate data from as well. I need to figure out how to create an entity model that is the result of this view (that includes a left join from a code-first table I have already migrated). During my research thus far, it seems that since EF3 there is support for views inside of Scaffold-DbContext, but my concern is I would only want to scaffold this single view, but still access everything inside the same DbContext I am already using. I don't want to hack things together, so please let me know how you would accomplish such a task in your project. Thanks for your help!
Looks like I was able to figure this out after all. The steps I did are as follows, but please correct me if you know a better or more accepted way.
Selected the SQL view into a new table so I could generate a create script off of it.
Copied the create script into the class creation tool over at https://codverter.com/src/sqltoclass so didn't have to manually convert 20+ columns and types to class properties.
Copied the generated properties into a new model class named after the SQL view
Added a new DbQuery under my existing DbSets in my DbContext class. (It does seem like DBQuery is deprecated, but I don't see another way around using it currently) and named it the same as my SQL view.
Scaffolded a new controller off the SQL views model class and navigated to the generated index page to verify data could be seen. (it worked!)
Let me know if you have any better ideas on how I came to this solution!

Merge two packages or try to solve circular dependency in Go lang

I'm creating a REST API, and I've separated each resource into it's own package. I've got a User and a Group package. There is a many to many relationship between the two resources. So I need User imported into the Group and Group imported to the User. Since both structs need them as fields.
My question is, should I create another package and import both and then import that package into each of these packages?
Or does it make more sense to combine these two packages into one in go lang?
Put them in the same package, but leave them in separate files.
What I have done in the same situation is:
I put the structures alone into a separate package models, which contains the structures for both as userModel.go and groupModel.go and have kept the functions related to user and group in their own package.
Both user and group packages include the model package.
However, this is a very opinionated answer. As Joshua's post says, we can also put everything together. The deciding factor should be, whether user and group functionalities would be used in other packages outside them or not. If so, then to keep a model package would have its benefits.

What's the easiest way to refresh Entity Model after adding/deleting DB fields?

Does anyone know what the esiest way to update the entity model after adding/deleting the fields in the database?
I am adding a few new fields to my database, then choose "Update Model from DB" and nothing happens. The model stays intact. Did anyone encounter the same problem?
Thanks for any feedback!
With EF that shipped for .net 3.5 I tend to follow the following steps:
Delete the connectionstring
Delete the model
Generate a new model
Build solution
This is perhaps not a very solid approach but it saves me time in the long run. In the future it is easier and more stable to do a refresh but I have gone from autogenerating my model to model-first.
I would definitely check out the EDM Generator which allows you to do a full generation of the model from scratch - Click here to go to the MSDN reference. It has saved me a lot of time and hope it will do the same for you.

iPhone Core Data Generated Model Files and Custom Code

After I've generated the interface/implementation files for entities of a model file in XCode, I've not found a way to keep any custom code (validation methods, etc...) I've added to those generated files, given the scenario where I've added an attribute to a model entity and need to re-generate the interface/implementation files. Does anyone know of a way to make this happen? I've just been doing the copy/paste shuffle, but there has to be a better way.
Assuming that you're only talking about adding methods, and not new instance variables, I'd recommend using Objective C categories to add additional behavior to your model classes. Here's a blog post along the same lines.
Use mogenerator, which uses the Generation Gap design pattern to prevent your customizations from being overwritten when the code is re-generated.