Question: My django app displays the objects from database in table view. The problem is that these objects (models) are pretty complex: the have 50+ fields. Nearly for each field I have to do some formatting:

* conver phone numbers from int 71234567689 to "+7 (123) 456789"
* display long prices with spaces: "7 000 000" instead of "7000000"
* construct full address from several fields like "street", "house" and so on (logic if pretty complex with several if-else-s)
* and so on

Django templating language has several useful tags for simple cases but I guess is not suitable in general case (like mine) for serious formatting.

Create the @property-s in model class is also not an option because the question is about rendering and is not related to model.

So I guess I should do my conversions in view: create dict for each obj, fill with converted data and pass to template. 

But! The model has a lot of fields and I don't want to copy them all :) Moreover, it would be great to preserve model structure to use it in django template (say, regroup) and query set laziness.

**So the greatest way would be to instruct django "how to render". Is it possible?**

Answer: 
I had the same problem but a fixed by:

```
@OneToMany
@JoinColumn(name = "assigned_ingredient", referencedColumnName = "ingredient_id")
@Fetch(FetchMode.JOIN) // Changing the fetch profile you can solve the problem
@Where(clause = "active_ind = 'Y'")
@OrderBy(clause = "meal_id ASC")
private List<Well> ingredients;

```

you can have more information here: <https://vladmihalcea.com/the-best-way-to-handle-the-lazyinitializationexception/>
I think the best solution to your problem (which also is the simplest) is to set your FetchType to LAZY and simply annotate the oneToMany collection fields using @transient.
Setting FetchType to EAGER isn't a good idea most times.
Best of luck.